<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://www.simulace.info/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dolj04</id>
	<title>Simulace.info - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://www.simulace.info/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dolj04"/>
	<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php/Special:Contributions/Dolj04"/>
	<updated>2026-07-27T09:32:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17137</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17137"/>
		<updated>2019-01-21T11:42:40Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Stratification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo is important but can be considered a straightforward technique. Its main issue is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods. &amp;lt;ref&amp;gt;Scratchapixel . Scratchapixel . Monte Carlo Methods in Practice. [Online] [Citation: 19. 1 2019.] https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;ref&amp;gt;Pevey, Dr. Ronald E. Variance Reduction Techniques. web.utk.edu. [Online] 9. 3 2015. [Citation: 19. 1 2019.] http://web.utk.edu/~rpevey/public/NE582/Chapter%204.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Paul Glasserman, David D. Yao. Some Guidelines and guarantees for common random numbers. MANAGEMENT SCIENCE. 38, 1992, No. 6.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run. &amp;lt;ref&amp;gt;The Use of Antithetic Variates in Computer Simulations, R. C. H. Cheng, The Journal of the Operational Research Society, Vol. 33, No. 3 (Mar., 1982), pp. 229-237&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling). &amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.|center|500px]]&lt;br /&gt;
Figure 1&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=WS_2018/2019&amp;diff=17136</id>
		<title>WS 2018/2019</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=WS_2018/2019&amp;diff=17136"/>
		<updated>2019-01-21T10:09:58Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Papers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Semestral papers from winter term 2018/2019. Please, put here links to the pages with your paper. First you need to have your [[Assignments WS 2018/2019|assignment approved]]&lt;br /&gt;
&lt;br /&gt;
==Simulations==&lt;br /&gt;
&lt;br /&gt;
--[[User:xvegm00|xvegm00]] [[User:Xvegm00|Xvegm00]] ([[User talk:Xvegm00|talk]]) 22:13, 8 January 2019 (CET) [[Simulation of semi-intelligent algae]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Doležálek [[User:Dolj04|Dolj04]] ([[User talk:Dolj04|talk]]) 16:50, 18 January 2019 (CET) [[Optimal size of HDD for virtual Digitization server]]&lt;br /&gt;
&lt;br /&gt;
-- Jiří Korčák [[User:Xkorj58|Xkorj58]] ([[User talk:Xkorj58|talk]]) 11:09, 19 January 2019 (CET) [[Vacuum cleaner]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Mandík [[User:Manj01|Manj01]] ([[User talk:Manj01|talk]]) 14:46, 19 January 2019 (CET) [[Ticket Solving Process at a Small IT dev Company]] &lt;br /&gt;
&lt;br /&gt;
-- [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 18:43, 19 January 2019 (CET) [[evacuation from burning building]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Xlazl00|Xlazl00]] ([[User talk:Xlazl00|talk]]) 12:11, 20 January 2019 (CET) [[Medieval Battle Simulation]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Qnesa01|Qnesa01]] ([User talk:Qnesa01|talk]]) 16:19, 20 January 2019 (CET) [[Argentinska Intersection]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Pippal (xpipj04) [[User:Janpippal|Janpippal]] 16:41, 20 January 2019 (CET) [[You are what you eat]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Kadj02|Kadj02]] ([[User talk:Kadj02|talk]]) 23:19, 20 January 2019 (CET) [[Slime mold]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Xkaij00|Xkaij00]] ([[User talk:Xkaij00|talk]]) 01:38, 21 January 2019 (CET) [[Simulation of north korea migration]]&lt;br /&gt;
&lt;br /&gt;
==Papers==&lt;br /&gt;
-- [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 20:43, 12 January 2019 (CET) [https://en.wikipedia.org/wiki/Data_flow_diagram Complete redo of DFD wikipedia]~&lt;br /&gt;
&lt;br /&gt;
-- [[User:Xvegm00|Xvegm00]] ([[User talk:Xvegm00|talk]]) 10:44, 17 January 2019 (CET)  [[http://www.simulace.info/index.php/Multi-agent_systems Multi-agent systems]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Pippal (xpipj04) [[User:Janpippal|Janpippal]] 4:48, 20 January 2019 (CET) [https://en.wikipedia.org/wiki/Draft:MMABP MMABP in English]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Qnesa01|Qnesa01]] ([User talk:Qnesa01|talk]]) 17:19, 20 January 2019 (CET) [[Limits to Growth_ver2]] (WIP)&lt;br /&gt;
&lt;br /&gt;
-- Tomáš Smysl (xsmyt00) [[User:Xsmyt00|Xsmyt00]] ([[User talk:Xsmyt00|talk]]) 22:36, 20 January 2019 (CET) [[https://en.wikipedia.org/wiki/ArchiMate ArchiMate wiki]] Note: I had some issues with the Wikipedia image upload - they did not approve my images. So the visual part of the Paper is missing examples of models that would ilustrate the text, which is quite unfortunate considering the topic is a visual modeling tool. I hope it can be solved later on. I even redrew some of the models so there would not be an issue with rights.&lt;br /&gt;
&lt;br /&gt;
-- Jan Doležálek [[User:Dolj04|Dolj04]] ([[User talk:Dolj04|talk]]) 11:09, 21 January 2019 (CET) [[http://www.simulace.info/index.php/Variance_reduction Variance reduction]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=WS_2018/2019&amp;diff=17135</id>
		<title>WS 2018/2019</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=WS_2018/2019&amp;diff=17135"/>
		<updated>2019-01-21T10:09:18Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Papers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Semestral papers from winter term 2018/2019. Please, put here links to the pages with your paper. First you need to have your [[Assignments WS 2018/2019|assignment approved]]&lt;br /&gt;
&lt;br /&gt;
==Simulations==&lt;br /&gt;
&lt;br /&gt;
--[[User:xvegm00|xvegm00]] [[User:Xvegm00|Xvegm00]] ([[User talk:Xvegm00|talk]]) 22:13, 8 January 2019 (CET) [[Simulation of semi-intelligent algae]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Doležálek [[User:Dolj04|Dolj04]] ([[User talk:Dolj04|talk]]) 16:50, 18 January 2019 (CET) [[Optimal size of HDD for virtual Digitization server]]&lt;br /&gt;
&lt;br /&gt;
-- Jiří Korčák [[User:Xkorj58|Xkorj58]] ([[User talk:Xkorj58|talk]]) 11:09, 19 January 2019 (CET) [[Vacuum cleaner]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Mandík [[User:Manj01|Manj01]] ([[User talk:Manj01|talk]]) 14:46, 19 January 2019 (CET) [[Ticket Solving Process at a Small IT dev Company]] &lt;br /&gt;
&lt;br /&gt;
-- [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 18:43, 19 January 2019 (CET) [[evacuation from burning building]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Xlazl00|Xlazl00]] ([[User talk:Xlazl00|talk]]) 12:11, 20 January 2019 (CET) [[Medieval Battle Simulation]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Qnesa01|Qnesa01]] ([User talk:Qnesa01|talk]]) 16:19, 20 January 2019 (CET) [[Argentinska Intersection]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Pippal (xpipj04) [[User:Janpippal|Janpippal]] 16:41, 20 January 2019 (CET) [[You are what you eat]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Kadj02|Kadj02]] ([[User talk:Kadj02|talk]]) 23:19, 20 January 2019 (CET) [[Slime mold]]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Xkaij00|Xkaij00]] ([[User talk:Xkaij00|talk]]) 01:38, 21 January 2019 (CET) [[Simulation of north korea migration]]&lt;br /&gt;
&lt;br /&gt;
==Papers==&lt;br /&gt;
-- [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 20:43, 12 January 2019 (CET) [https://en.wikipedia.org/wiki/Data_flow_diagram Complete redo of DFD wikipedia]~&lt;br /&gt;
&lt;br /&gt;
-- [[User:Xvegm00|Xvegm00]] ([[User talk:Xvegm00|talk]]) 10:44, 17 January 2019 (CET)  [[http://www.simulace.info/index.php/Multi-agent_systems Multi-agent systems]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Pippal (xpipj04) [[User:Janpippal|Janpippal]] 4:48, 20 January 2019 (CET) [https://en.wikipedia.org/wiki/Draft:MMABP MMABP in English]&lt;br /&gt;
&lt;br /&gt;
-- [[User:Qnesa01|Qnesa01]] ([User talk:Qnesa01|talk]]) 17:19, 20 January 2019 (CET) [[Limits to Growth_ver2]] (WIP)&lt;br /&gt;
&lt;br /&gt;
-- Tomáš Smysl (xsmyt00) [[User:Xsmyt00|Xsmyt00]] ([[User talk:Xsmyt00|talk]]) 22:36, 20 January 2019 (CET) [[https://en.wikipedia.org/wiki/ArchiMate ArchiMate wiki]] Note: I had some issues with the Wikipedia image upload - they did not approve my images. So the visual part of the Paper is missing examples of models that would ilustrate the text, which is quite unfortunate considering the topic is a visual modeling tool. I hope it can be solved later on. I even redrew some of the models so there would not be an issue with rights.&lt;br /&gt;
&lt;br /&gt;
-- [[User:Dolj04|Dolj04]] ([[User talk:Dolj04|talk]]) 11:09, 21 January 2019 (CET) [[http://www.simulace.info/index.php/Variance_reduction]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17134</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17134"/>
		<updated>2019-01-21T10:07:13Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Stratification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo is important but can be considered a straightforward technique. Its main issue is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods. &amp;lt;ref&amp;gt;Scratchapixel . Scratchapixel . Monte Carlo Methods in Practice. [Online] [Citation: 19. 1 2019.] https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;ref&amp;gt;Pevey, Dr. Ronald E. Variance Reduction Techniques. web.utk.edu. [Online] 9. 3 2015. [Citation: 19. 1 2019.] http://web.utk.edu/~rpevey/public/NE582/Chapter%204.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Paul Glasserman, David D. Yao. Some Guidelines and guarantees for common random numbers. MANAGEMENT SCIENCE. 38, 1992, No. 6.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run. &amp;lt;ref&amp;gt;The Use of Antithetic Variates in Computer Simulations, R. C. H. Cheng, The Journal of the Operational Research Society, Vol. 33, No. 3 (Mar., 1982), pp. 229-237&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling). &amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.|center|500px]]&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=File:StratifiedSamples.png&amp;diff=17133</id>
		<title>File:StratifiedSamples.png</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=File:StratifiedSamples.png&amp;diff=17133"/>
		<updated>2019-01-21T10:06:35Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=File:Dolj04_Optimal_size_of_HDD_for_virtual_Digitization_server.xlsx&amp;diff=17132</id>
		<title>File:Dolj04 Optimal size of HDD for virtual Digitization server.xlsx</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=File:Dolj04_Optimal_size_of_HDD_for_virtual_Digitization_server.xlsx&amp;diff=17132"/>
		<updated>2019-01-21T10:05:58Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=17131</id>
		<title>Optimal size of HDD for virtual Digitization server</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=17131"/>
		<updated>2019-01-21T10:05:33Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Derivation of probability distributions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Proper usage of server space and capacity is very important for companies these days as the volume of data gathered and produced is growing rapidly and is essential for proper operation of modern companies.&lt;br /&gt;
This simulation is designed to calculate optimal HDD size for a server which is used for processing documents and is based on real data obtained from a company production server.&lt;br /&gt;
&lt;br /&gt;
=Problem definition=&lt;br /&gt;
The simulation is based on data gathered by a server application in database, observations of the server (mainly focused on batch count and their size) and additional information about the solution running on the server gathered from documentation:&lt;br /&gt;
*Processing takes place only on work days&lt;br /&gt;
*Every document scanned to the server is processed by a digitization application which creates batch that contains original scanned document, extracted data in XML files, log files, enhanced images and searchable PDF&lt;br /&gt;
*Application saves all important information about batches in database&lt;br /&gt;
*Backup images from scanning will stay on the server for 6 months (those are additional ~50 % of the batch size) and are in separate folder from the batch folders&lt;br /&gt;
*Successfully processed batches older than 14 days are deleted every day by another application that also produces log files about the successful/failed deletion&lt;br /&gt;
*For precaution let’s assume 5% of batches could fail to be processed correctly (however in obtained sample all batches were processed correctly)&lt;br /&gt;
**Those will stay on the server and will be processed every 6 months by admins when deleting backup&lt;br /&gt;
&lt;br /&gt;
==Observation==&lt;br /&gt;
First observation was made to assess the data available and to decide about proper approach when designing the simulation. &lt;br /&gt;
Information gathered during observation:&lt;br /&gt;
*Each day an average of 17 batches were processed by the server with average size per batch of 24 MB&lt;br /&gt;
*The number of batches changes a lot and can’t be easily predicted so it will have to be taken into consideration&lt;br /&gt;
*Information about deleted batches can be found in database on the server&lt;br /&gt;
&lt;br /&gt;
==Simulation environment==&lt;br /&gt;
MS Excel 2016&lt;br /&gt;
==Simulation method==&lt;br /&gt;
Monte Carlo&lt;br /&gt;
&lt;br /&gt;
=Obtaining real data=&lt;br /&gt;
The data for simulation was extracted from a database which contains information about all the batches that were processed on the server during the last 65 working days. Total of 1124 batches were processed during those days. Important part of the database table needed for simulation is included in the MS Excel file. &lt;br /&gt;
&lt;br /&gt;
=Derivation of probability distributions=&lt;br /&gt;
After the data was gathered and analyzed through a contingency table, graphs were made to display the average batch size (in bins with increment of 5000 KB) and the average batch count per day. Both those graphs are from the log-normal distribution and so the random values were generated based on those distributions for average batch size as well as the average batch count.&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution1.png|Number o batches in size bins (batch size range of 5000 KB, average)|center|500px|]]&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution2.png|Number of different batch count occurances (average)|center|500px|]]&lt;br /&gt;
&lt;br /&gt;
=Simulation=&lt;br /&gt;
For the simulation 132 working days (6 months) were considered as the time before backup deletion and error fix-up takes place. For both average batch size and average batch count random values were generated from the log-normal distribution based on scaled mean (m) and standard deviation (s) of the original data set.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those random values were generated 132 times and then multiplied. After multiplication of those 2 values followed calculating the error and backup size and the cumulative size which was reduced each step starting at 10 steps (14 days for deletion of the oldest batch). Overall size after 6 months was used in excel data table to generate this simulation 1000 times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Results=&lt;br /&gt;
After generating 1000 simulations the AVG, highest and lowest space needed was calculated and is displayed in table below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+1000 simulations results&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|In KB&lt;br /&gt;
|In MB&lt;br /&gt;
|In GB&lt;br /&gt;
|-&lt;br /&gt;
|'''AVG Space needed:'''&lt;br /&gt;
|35189448.7&lt;br /&gt;
|34364.7&lt;br /&gt;
|33.55927&lt;br /&gt;
|-&lt;br /&gt;
|'''Highest space needed:'''&lt;br /&gt;
|105577213&lt;br /&gt;
|103102.7&lt;br /&gt;
|100.6863&lt;br /&gt;
|-&lt;br /&gt;
|'''Lowest space needed:'''&lt;br /&gt;
|21607404.9&lt;br /&gt;
|21100.98&lt;br /&gt;
|20.60643&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Issue with the results is that the highest space needed changes a lot (because the batch size and count changes a lot as was mentioned at the beginning of the paper) even when running the simulation 1000 times. It had to be taken into consideration when deriving conclusions.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
One option for the company when deciding how much space should be reserved for document processing based on the simulation would be to take into consideration the highest space needed from 1000 simulations which is nearly 101 GB. Second recommendation, when using this option, would be to monitor the server at least once a month as the highest value varies a lot and adjust the size if needed. Upside of this approach is that it requires less initial work.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Due to high variance another approach for defining the space needed is to consider only the average space needed so the HDD would have “only” 34 GB free space starting each 6 months. However, when using this approach, if the HDD starts getting full, increasing the size automatically based on the last month when backup deletion took place is necessary. Upside of this solution is proper space utilization as most of the time big part of disk space would be unused if one considers only the highest size needed (based on the average space needed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code=&lt;br /&gt;
&lt;br /&gt;
The Excel file with simulation can be found here:&lt;br /&gt;
https://app.box.com/s/duj71rtgvf4g1u9gi011tcib2umnjdil&lt;br /&gt;
&lt;br /&gt;
[[File:dolj04_Optimal size of HDD for virtual Digitization server.xlsx]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=17130</id>
		<title>Optimal size of HDD for virtual Digitization server</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=17130"/>
		<updated>2019-01-21T10:04:51Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Derivation of probability distributions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Proper usage of server space and capacity is very important for companies these days as the volume of data gathered and produced is growing rapidly and is essential for proper operation of modern companies.&lt;br /&gt;
This simulation is designed to calculate optimal HDD size for a server which is used for processing documents and is based on real data obtained from a company production server.&lt;br /&gt;
&lt;br /&gt;
=Problem definition=&lt;br /&gt;
The simulation is based on data gathered by a server application in database, observations of the server (mainly focused on batch count and their size) and additional information about the solution running on the server gathered from documentation:&lt;br /&gt;
*Processing takes place only on work days&lt;br /&gt;
*Every document scanned to the server is processed by a digitization application which creates batch that contains original scanned document, extracted data in XML files, log files, enhanced images and searchable PDF&lt;br /&gt;
*Application saves all important information about batches in database&lt;br /&gt;
*Backup images from scanning will stay on the server for 6 months (those are additional ~50 % of the batch size) and are in separate folder from the batch folders&lt;br /&gt;
*Successfully processed batches older than 14 days are deleted every day by another application that also produces log files about the successful/failed deletion&lt;br /&gt;
*For precaution let’s assume 5% of batches could fail to be processed correctly (however in obtained sample all batches were processed correctly)&lt;br /&gt;
**Those will stay on the server and will be processed every 6 months by admins when deleting backup&lt;br /&gt;
&lt;br /&gt;
==Observation==&lt;br /&gt;
First observation was made to assess the data available and to decide about proper approach when designing the simulation. &lt;br /&gt;
Information gathered during observation:&lt;br /&gt;
*Each day an average of 17 batches were processed by the server with average size per batch of 24 MB&lt;br /&gt;
*The number of batches changes a lot and can’t be easily predicted so it will have to be taken into consideration&lt;br /&gt;
*Information about deleted batches can be found in database on the server&lt;br /&gt;
&lt;br /&gt;
==Simulation environment==&lt;br /&gt;
MS Excel 2016&lt;br /&gt;
==Simulation method==&lt;br /&gt;
Monte Carlo&lt;br /&gt;
&lt;br /&gt;
=Obtaining real data=&lt;br /&gt;
The data for simulation was extracted from a database which contains information about all the batches that were processed on the server during the last 65 working days. Total of 1124 batches were processed during those days. Important part of the database table needed for simulation is included in the MS Excel file. &lt;br /&gt;
&lt;br /&gt;
=Derivation of probability distributions=&lt;br /&gt;
After the data was gathered and analyzed through a contingency table, graphs were made to display the average batch size (in bins with increment of 5000 KB) and the average batch count per day. Both those graphs are from the log-normal distribution and so the random values were generated based on those distributions for average batch size as well as the average batch count.&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution1.png|Number o batches in size bins (batch size range of 5000 KB, average)|center]]&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution2.png|Number of different batch count occurances (average)|center]]&lt;br /&gt;
&lt;br /&gt;
=Simulation=&lt;br /&gt;
For the simulation 132 working days (6 months) were considered as the time before backup deletion and error fix-up takes place. For both average batch size and average batch count random values were generated from the log-normal distribution based on scaled mean (m) and standard deviation (s) of the original data set.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those random values were generated 132 times and then multiplied. After multiplication of those 2 values followed calculating the error and backup size and the cumulative size which was reduced each step starting at 10 steps (14 days for deletion of the oldest batch). Overall size after 6 months was used in excel data table to generate this simulation 1000 times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Results=&lt;br /&gt;
After generating 1000 simulations the AVG, highest and lowest space needed was calculated and is displayed in table below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+1000 simulations results&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|In KB&lt;br /&gt;
|In MB&lt;br /&gt;
|In GB&lt;br /&gt;
|-&lt;br /&gt;
|'''AVG Space needed:'''&lt;br /&gt;
|35189448.7&lt;br /&gt;
|34364.7&lt;br /&gt;
|33.55927&lt;br /&gt;
|-&lt;br /&gt;
|'''Highest space needed:'''&lt;br /&gt;
|105577213&lt;br /&gt;
|103102.7&lt;br /&gt;
|100.6863&lt;br /&gt;
|-&lt;br /&gt;
|'''Lowest space needed:'''&lt;br /&gt;
|21607404.9&lt;br /&gt;
|21100.98&lt;br /&gt;
|20.60643&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Issue with the results is that the highest space needed changes a lot (because the batch size and count changes a lot as was mentioned at the beginning of the paper) even when running the simulation 1000 times. It had to be taken into consideration when deriving conclusions.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
One option for the company when deciding how much space should be reserved for document processing based on the simulation would be to take into consideration the highest space needed from 1000 simulations which is nearly 101 GB. Second recommendation, when using this option, would be to monitor the server at least once a month as the highest value varies a lot and adjust the size if needed. Upside of this approach is that it requires less initial work.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Due to high variance another approach for defining the space needed is to consider only the average space needed so the HDD would have “only” 34 GB free space starting each 6 months. However, when using this approach, if the HDD starts getting full, increasing the size automatically based on the last month when backup deletion took place is necessary. Upside of this solution is proper space utilization as most of the time big part of disk space would be unused if one considers only the highest size needed (based on the average space needed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code=&lt;br /&gt;
&lt;br /&gt;
The Excel file with simulation can be found here:&lt;br /&gt;
https://app.box.com/s/duj71rtgvf4g1u9gi011tcib2umnjdil&lt;br /&gt;
&lt;br /&gt;
[[File:dolj04_Optimal size of HDD for virtual Digitization server.xlsx]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=File:Lognormaldistribution2.png&amp;diff=17129</id>
		<title>File:Lognormaldistribution2.png</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=File:Lognormaldistribution2.png&amp;diff=17129"/>
		<updated>2019-01-21T10:03:08Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=File:Lognormaldistribution1.png&amp;diff=17128</id>
		<title>File:Lognormaldistribution1.png</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=File:Lognormaldistribution1.png&amp;diff=17128"/>
		<updated>2019-01-21T10:02:51Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=17094</id>
		<title>Optimal size of HDD for virtual Digitization server</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=17094"/>
		<updated>2019-01-20T16:50:16Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Proper usage of server space and capacity is very important for companies these days as the volume of data gathered and produced is growing rapidly and is essential for proper operation of modern companies.&lt;br /&gt;
This simulation is designed to calculate optimal HDD size for a server which is used for processing documents and is based on real data obtained from a company production server.&lt;br /&gt;
&lt;br /&gt;
=Problem definition=&lt;br /&gt;
The simulation is based on data gathered by a server application in database, observations of the server (mainly focused on batch count and their size) and additional information about the solution running on the server gathered from documentation:&lt;br /&gt;
*Processing takes place only on work days&lt;br /&gt;
*Every document scanned to the server is processed by a digitization application which creates batch that contains original scanned document, extracted data in XML files, log files, enhanced images and searchable PDF&lt;br /&gt;
*Application saves all important information about batches in database&lt;br /&gt;
*Backup images from scanning will stay on the server for 6 months (those are additional ~50 % of the batch size) and are in separate folder from the batch folders&lt;br /&gt;
*Successfully processed batches older than 14 days are deleted every day by another application that also produces log files about the successful/failed deletion&lt;br /&gt;
*For precaution let’s assume 5% of batches could fail to be processed correctly (however in obtained sample all batches were processed correctly)&lt;br /&gt;
**Those will stay on the server and will be processed every 6 months by admins when deleting backup&lt;br /&gt;
&lt;br /&gt;
==Observation==&lt;br /&gt;
First observation was made to assess the data available and to decide about proper approach when designing the simulation. &lt;br /&gt;
Information gathered during observation:&lt;br /&gt;
*Each day an average of 17 batches were processed by the server with average size per batch of 24 MB&lt;br /&gt;
*The number of batches changes a lot and can’t be easily predicted so it will have to be taken into consideration&lt;br /&gt;
*Information about deleted batches can be found in database on the server&lt;br /&gt;
&lt;br /&gt;
==Simulation environment==&lt;br /&gt;
MS Excel 2016&lt;br /&gt;
==Simulation method==&lt;br /&gt;
Monte Carlo&lt;br /&gt;
&lt;br /&gt;
=Obtaining real data=&lt;br /&gt;
The data for simulation was extracted from a database which contains information about all the batches that were processed on the server during the last 65 working days. Total of 1124 batches were processed during those days. Important part of the database table needed for simulation is included in the MS Excel file. &lt;br /&gt;
&lt;br /&gt;
=Derivation of probability distributions=&lt;br /&gt;
After the data was gathered and analyzed through a contingency table, graphs were made to display the average batch size (in bins with increment of 5000 KB) and the average batch count per day. Both those graphs are from the log-normal distribution and so the random values were generated based on those distributions for average batch size as well as the average batch count.&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution1.png|Number o batches in size bins (batch size range of 5000 KB, average)]]&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution2.png|Number of different batch count occurances (average)]]&lt;br /&gt;
&lt;br /&gt;
=Simulation=&lt;br /&gt;
For the simulation 132 working days (6 months) were considered as the time before backup deletion and error fix-up takes place. For both average batch size and average batch count random values were generated from the log-normal distribution based on scaled mean (m) and standard deviation (s) of the original data set.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those random values were generated 132 times and then multiplied. After multiplication of those 2 values followed calculating the error and backup size and the cumulative size which was reduced each step starting at 10 steps (14 days for deletion of the oldest batch). Overall size after 6 months was used in excel data table to generate this simulation 1000 times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Results=&lt;br /&gt;
After generating 1000 simulations the AVG, highest and lowest space needed was calculated and is displayed in table below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+1000 simulations results&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|In KB&lt;br /&gt;
|In MB&lt;br /&gt;
|In GB&lt;br /&gt;
|-&lt;br /&gt;
|'''AVG Space needed:'''&lt;br /&gt;
|35189448.7&lt;br /&gt;
|34364.7&lt;br /&gt;
|33.55927&lt;br /&gt;
|-&lt;br /&gt;
|'''Highest space needed:'''&lt;br /&gt;
|105577213&lt;br /&gt;
|103102.7&lt;br /&gt;
|100.6863&lt;br /&gt;
|-&lt;br /&gt;
|'''Lowest space needed:'''&lt;br /&gt;
|21607404.9&lt;br /&gt;
|21100.98&lt;br /&gt;
|20.60643&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Issue with the results is that the highest space needed changes a lot (because the batch size and count changes a lot as was mentioned at the beginning of the paper) even when running the simulation 1000 times. It had to be taken into consideration when deriving conclusions.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
One option for the company when deciding how much space should be reserved for document processing based on the simulation would be to take into consideration the highest space needed from 1000 simulations which is nearly 101 GB. Second recommendation, when using this option, would be to monitor the server at least once a month as the highest value varies a lot and adjust the size if needed. Upside of this approach is that it requires less initial work.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Due to high variance another approach for defining the space needed is to consider only the average space needed so the HDD would have “only” 34 GB free space starting each 6 months. However, when using this approach, if the HDD starts getting full, increasing the size automatically based on the last month when backup deletion took place is necessary. Upside of this solution is proper space utilization as most of the time big part of disk space would be unused if one considers only the highest size needed (based on the average space needed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code=&lt;br /&gt;
&lt;br /&gt;
The Excel file with simulation can be found here:&lt;br /&gt;
https://app.box.com/s/duj71rtgvf4g1u9gi011tcib2umnjdil&lt;br /&gt;
&lt;br /&gt;
[[File:dolj04_Optimal size of HDD for virtual Digitization server.xlsx]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17088</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17088"/>
		<updated>2019-01-20T16:36:12Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo is important but can be considered a straightforward technique. Its main issue is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods. &amp;lt;ref&amp;gt;Scratchapixel . Scratchapixel . Monte Carlo Methods in Practice. [Online] [Citation: 19. 1 2019.] https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;ref&amp;gt;Pevey, Dr. Ronald E. Variance Reduction Techniques. web.utk.edu. [Online] 9. 3 2015. [Citation: 19. 1 2019.] http://web.utk.edu/~rpevey/public/NE582/Chapter%204.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Paul Glasserman, David D. Yao. Some Guidelines and guarantees for common random numbers. MANAGEMENT SCIENCE. 38, 1992, No. 6.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run. &amp;lt;ref&amp;gt;The Use of Antithetic Variates in Computer Simulations, R. C. H. Cheng, The Journal of the Operational Research Society, Vol. 33, No. 3 (Mar., 1982), pp. 229-237&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling). &amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17087</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17087"/>
		<updated>2019-01-20T16:35:51Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo is important but can be considered a straightforward technique. Its main issue is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods. &amp;lt;ref&amp;gt;Scratchapixel . Scratchapixel . Monte Carlo Methods in Practice. [Online] [Citation: 19. 1 2019.] https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;ref&amp;gt;Pevey, Dr. Ronald E. Variance Reduction Techniques. web.utk.edu. [Online] 9. 3 2015. [Citation: 19. 1 2019.] http://web.utk.edu/~rpevey/public/NE582/Chapter%204.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Paul Glasserman, David D. Yao. Some Guidelines and guarantees for common random numbers. MANAGEMENT SCIENCE. 38, 1992, No. 6.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run. &amp;lt;ref&amp;gt;The Use of Antithetic Variates in Computer Simulations, R. C. H. Cheng, The Journal of the Operational Research Society, Vol. 33, No. 3 (Mar., 1982), pp. 229-237&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling). &amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17086</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17086"/>
		<updated>2019-01-20T16:34:08Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo is important but can be considered a straightforward technique. Its main issue is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods. &amp;lt;ref&amp;gt;Scratchapixel . Scratchapixel . Monte Carlo Methods in Practice. [Online] [Citation: 19. 1 2019.] https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;ref&amp;gt;Pevey, Dr. Ronald E. Variance Reduction Techniques. web.utk.edu. [Online] 9. 3 2015. [Citation: 19. 1 2019.] http://web.utk.edu/~rpevey/public/NE582/Chapter%204.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citation: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Paul Glasserman, David D. Yao. Some Guidelines and guarantees for common random numbers. MANAGEMENT SCIENCE. 38, 1992, No. 6.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run. &amp;lt;ref&amp;gt;The Use of Antithetic Variates in Computer Simulations, R. C. H. Cheng, The Journal of the Operational Research Society, Vol. 33, No. 3 (Mar., 1982), pp. 229-237&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling). &amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citation: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17085</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17085"/>
		<updated>2019-01-20T16:31:19Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo is important but can be considered a straightforward technique. Its main issue is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods. &amp;lt;ref&amp;gt;Scratchapixel . Scratchapixel . Monte Carlo Methods in Practice. [Online] [Citation: 19. 1 2019.] https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods.&amp;lt;/ref&amp;gt; &lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citace: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citace: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citace: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;ref&amp;gt;Pevey, Dr. Ronald E. Variance Reduction Techniques. web.utk.edu. [Online] 9. 3 2015. [Citace: 19. 1 2019.] http://web.utk.edu/~rpevey/public/NE582/Chapter%204.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt; &lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&amp;lt;ref&amp;gt;Zdravko Botev, Ad Ridder. Variance Reduction. School of Mathematics and Statistics. [Online] 2017. [Citace: 19. 1 2019.] https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Paul Glasserman, David D. Yao. Some Guidelines and guarantees for common random numbers. MANAGEMENT SCIENCE. 38, 1992, No. 6.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers &amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run. &amp;lt;ref&amp;gt;The Use of Antithetic Variates in Computer Simulations, R. C. H. Cheng, The Journal of the Operational Research Society, Vol. 33, No. 3 (Mar., 1982), pp. 229-237&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;Resing, Jacques. Variance Reduction Techniques. Lecture notes. [Online] [Citation: 19. 1 2019.] https://www.win.tue.nl/~resing/2S540/week6.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling). &amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citace: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&amp;lt;ref&amp;gt;Owen, Art B. Monte Carlo theory, methods and examples. Stanford.edu. [Online] 2013. [Citace: 19. 1 2019.] https://statweb.stanford.edu/~owen/mc/Ch-var-basic.pdf&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;br /&gt;
&lt;br /&gt;
= References =&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17075</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17075"/>
		<updated>2019-01-20T15:50:43Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo is important but can be considered a straightforward technique. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run.&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17074</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17074"/>
		<updated>2019-01-20T15:49:33Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ^2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e^(-x) the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run.&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ^2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ^2 by only 10%. What is more regrettable, few methods will raise σ^2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ^2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ0^2/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ^2 we need n = σ0^2/τ^2 and this will cost c0σ0^2/τ^2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ1^2/n and cost nc1 under these conditions, then it will cost us c1σ1^2/τ2 to achieve the same error variance τ^2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ0^2/ c1σ1^2. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ0^2/σ1^2 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17073</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17073"/>
		<updated>2019-01-20T15:45:01Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ*σ/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e−x the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin: auto;&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run.&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17072</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17072"/>
		<updated>2019-01-20T15:42:42Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ*σ/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 1 ===&lt;br /&gt;
&lt;br /&gt;
Assume that a limited number of N jobs must be handled on two indistinguishable machines. The processing times of the jobs are random variables with some common distribution function F. We want to compare the completion time of the last job, Cmax, under two different policies. In the LPTF policy, we always choose the remaining job with the longest processing time first, in the SPTF policy we choose the remaining job with the shortest processing time first. In Table 1 and Table 2 we compare for N = 10 and F(x) = 1 − e−x the estimators and confidence intervals for E(C SPTF max − C LPTF max ) when we do not, resp. do, use CRN. We conclude that in this example the use of CRN reduces the standard deviation of the estimator and hence also the length of the confidence interval with a factor 5. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Table 1: Estimation of E(C SPTF max − C LPTF max) without using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8138&lt;br /&gt;
|2.5745&lt;br /&gt;
|[0.645, 0.973]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8293&lt;br /&gt;
|2.4976&lt;br /&gt;
|[0.780, 0.878]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8487&lt;br /&gt;
|2.4990&lt;br /&gt;
|[0.833, 0.864]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8398&lt;br /&gt;
|2.4951 &lt;br /&gt;
|[0.835, 0.845]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Table 2: Estimation of E(C SPTF max − C LPTF max) using common random numbers&lt;br /&gt;
|-&lt;br /&gt;
|# of runs&lt;br /&gt;
|mean&lt;br /&gt;
|st. dev&lt;br /&gt;
|95% conf. int.&lt;br /&gt;
|-&lt;br /&gt;
|1000&lt;br /&gt;
|0.8559&lt;br /&gt;
|0.5416&lt;br /&gt;
|[0.822, 0.889]&lt;br /&gt;
|-&lt;br /&gt;
|10000&lt;br /&gt;
|0.8415&lt;br /&gt;
|0.5230&lt;br /&gt;
|[0.831, 0.852]&lt;br /&gt;
|-&lt;br /&gt;
|100000&lt;br /&gt;
|0.8394&lt;br /&gt;
|0.5164&lt;br /&gt;
|[0.836, 0.843]&lt;br /&gt;
|-&lt;br /&gt;
|1000000&lt;br /&gt;
|0.8391&lt;br /&gt;
|0.5168&lt;br /&gt;
|[0.838, 0.840]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example 2 ===&lt;br /&gt;
&lt;br /&gt;
When we want to use CRN, the problem of synchronization can arise: How can we achieve that the same random numbers are used for the generation of the same random variables in the two systems? In the previous example, this synchronization problem did not arise. However, to illustrate this problem, consider the following situation. In a G/G/1 queueing system the server can work at two different speeds, v1 and v2. Aim of the simulation is to obtain an estimator for the difference of the waiting times in the two situations. We want to use the same realizations of the interarrival times and the sizes of the service requests in both systems (the service time is then given by the sizes of the service request divided by the speed of the server). If we use the program of the discrete event simulation of Section 3 of the G/G/1 queue, then we get the synchronization problem because the order in which departure and arrival events take place depends on the speed of the server. Hence, also the order in which interarrival times and sizes of service requests are generated depend on the speed of the server. The synchronization problem can be solved by one of the following two approaches: 1. Use separate random number streams for the different sequences of random variables needed in the simulation. 2. Assure that the random variables are generated in exactly the same order in the two systems. For the example of the G/G/1 queue, the first approach can be realized by using a separate random number stream for the interarrival times and for the service requests. The second approach can be realized by generating the service request of a customer already at the arrival instant of the customer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run.&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17064</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17064"/>
		<updated>2019-01-20T15:26:40Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Stratification */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ*σ/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run.&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
[[File:stratifiedSamples.png|The left panel shows 20 points xi ∈ [0, 1]2 of which 5 are sampled uniformly from within each of four quadrants. The right panel shows 21 points from the N (0, I2) distribution. There are 6 concentric rings separating the distribution into 7 equally probable strata. Each stratum has 3 points sampled from within it.]]&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17060</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17060"/>
		<updated>2019-01-20T15:20:14Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ*σ/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run.&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17058</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17058"/>
		<updated>2019-01-20T15:01:14Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Antithetic variables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. The key idea is that, if W1 and W2 are the outcomes of two successive simulation runs, then Var(W1 + W2/2)=1/4Var(W1)+1/4Var(W2)+1/2Cov(W1, W2). Hence, in the case that W1 and W2 are negatively correlated the variance of (W1 + W2)/2 will be smaller than in the case that W1 and W2 are independent. The question remains how we can achieve that the outcome of two successive simulation runs will be negatively correlated. From the fact that U and 1 − U are negatively correlated, we may expect that, if we use the random variables U1,...,Um to compute W1, the outcome of the first simulation run, and after that 1 − U1,...,1−Um to compute W2, the outcome of the second simulation run, then also W1 and W2 are negatively correlated. Intuition here is that, e.g., in the simulation of the G/G/1 queue large realizations of the Ui’s corresponding to large service times lead to large waiting times in the first run. Using the antithetic variables, this gives small realizations of the 1−Ui’s corresponding to small service times and hence leading to small waiting times in the second run.&lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17057</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17057"/>
		<updated>2019-01-20T14:56:25Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Measuring variance reduction efficiency */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. &lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17055</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17055"/>
		<updated>2019-01-20T14:38:11Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Variance reduction techniques */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods consists of heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. &lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for enlivened movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17054</id>
		<title>Variance reduction</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Variance_reduction&amp;diff=17054"/>
		<updated>2019-01-20T14:33:09Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: Variance reduction (textbook text)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Monte Carlo can be considered a straightforward (but important) technique as one can notice. Its main issue though is variance. To try to get rid of it, what can be done is to increase the number of samples N. However, each time we want to reduce variance two times, we need four fold the number of samples (for the blunder to diminish linearly, the quantity of tests needs to increase exponentially). Because of that great deal of research was invested into discovering whether change could be decreased by some other mean than simply expanding N. Luckily, mathematics can help answering this question. Monte Carlo integration typically has an error variance of the form σ2/N. Even though we get a better answer by sampling with a larger value of N, the computing time grows with N. Sometimes it is conceivable to decrease σ instead. To do this, we construct a new Monte Carlo problem with the same answer as our original one but with a lower σ. This leads to an entire branch in Monte Carlo research focused on what's known as variance reduction methods.&amp;lt;br/&amp;gt;&lt;br /&gt;
When do we need variance reduction? It is mostly needed in simulations of highly complex models with high computation cost per replication, and in simulations of rare events with too many replications in crude Monte Carlo. There are many applications of these phenomena in a variety of fields, for example: physics, finance, statistics, reliability or systems biology.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Variance reduction techniques =&lt;br /&gt;
In this chapter can be found description for some of the popular classic variance reduction techniques, mainly focusing on antithetic variables and common random numbers (CRN). CRN is commonly utilized in a simulation study in which we want to compare performance measures of two distinct systems. Every single other method (for instance antithetic variables, stratification) is valuable in the case that we want to simulate a performance measure of only a single system. These methods all enhance effectiveness by sampling the input values more strategically. Next let’s consider conditioning and control variates. These methods take advantage of closed form solutions to problems similar to the given one. Another major method is importance sampling. Like some of the other methods, importance sampling also changes where we take the sample values, but rather than distributing them in more balanced ways it purposely oversamples from some regions and then corrects for this distortion by reweighting. It is accordingly an extreme reformulation of the issue and can be dubious to do well. &amp;lt;br/&amp;gt;&lt;br /&gt;
Other group of methods are heuristic variance reduction techniques. Amongst them we can find some of those popular techniques: Weighting in lieu of absorption, Splitting, Forced collisions, Russian roulette, etc. Underlying idea here is that we want to choose from a probability distribution that we want to use rather than using the one that the physical data indicates.&amp;lt;br/&amp;gt;&lt;br /&gt;
Last group we will mention here are more modern methods which include Quasi Monte Carlo and Multilevel Monte Carlo Estimator techniques.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Common Random Numbers ==&lt;br /&gt;
&lt;br /&gt;
Common random numbers (CRN) is the simplest and presumably the most widely used method for increasing the efficiency of comparisons via simulation. It is intuitively appealing and easy to implement in either a custom-made simulation or in a simulation package. In its simplest form, CRN just requires that the systems under study be simulated with the same stream of random numbers. Naturally, this appears to be reasonable since it guarantees that the frameworks are thought about under same conditions. Key idea in the method is that on the off chance X and Y are two random variables, then Var(X−Y) = Var(X) + Var(Y) − 2Cov(X, Y). Thus, for the situation that X and Y are positively correlated, i.e. Cov(X,Y)&amp;gt;0, the variance of X − Y will be smaller than in the case that X and Y are independent. In general, the use of common random numbers leads to positive correlation of the outcomes of a simulation of two systems. As a consequence, it is better to use common random numbers instead of independent random numbers when we compare two different systems.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Antithetic variables ==&lt;br /&gt;
The method of antithetic variables is a frequently suggested technique for reducing the variability of estimators in computer simulation experiments. In practice the method does not appear to work as well as it might and hence is not used as often as it should. The idea in the technique of antithetic variables is as follows: It makes use of the fact that if U is uniformly distributed on (0, 1) then so is 1 − U and furthermore U and 1 − U are negatively correlated. &lt;br /&gt;
&lt;br /&gt;
== Stratification ==&lt;br /&gt;
&lt;br /&gt;
Now, let’s just briefly mention the thought behind stratified sampling which is to split up the domain D of X into separate regions, take a well-defined sample of points from each such region, and combine the results to estimate E(f(X)). Naturally, on the off chance that every area gets a lot of points then we ought to get an improved answer. Figure 1 shows two little instances of stratified domains. We may have the capacity to improve the situation still by oversampling inside the vital strata and under sampling those in which f is almost consistent (similar to methods of importance sampling).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Measuring variance reduction efficiency  =&lt;br /&gt;
Using variance reduction can sometimes bring tremendous enhancements in contrast with conducting plain Monte Carlo. It isn’t exceptional for the value σ2 to be reduced thousand times (or more). Unfortunately, it is likewise possible for a variance reduction technique to bring a very modest improvement, perhaps equivalent to diminishing σ2 by only 10%. What is more regrettable, few methods will raise σ2 in unwanted circumstances. The estimation of a variance reduction relies upon more than the change in σ2. It likewise relies upon the PC's running time, perhaps the memory expended, and significantly, the human time taken to program and test the code. Suppose for simplicity, that a baseline method is unbiased and estimates the desired quantity with variance σ20/n, at a cost of nc0, when n function evaluations are used. To get an error variance of τ2 we need n = σ20/τ2 and this will cost c0σ20/τ2. Here we are assuming that cost is measured in time and that overhead cost is small. On the off chance that an alternative fair-minded method has variance σ21/n and cost nc1 under these conditions, then it will cost us c1σ21/τ2 to achieve the same error variance τ2 that the baseline method achieved. The efficiency of the new method, relative to the standard method is E = c0σ20/ c1σ21. At any fixed level of accuracy, the old method takes E times as much work as the new one. The efficiency has two factors, σ20/ σ21 and c0/c1. The first is a mathematical property of the two methods that we can often handle theoretically. The second is more complicated. It can depend heavily on the algorithms used for each method. It can also depend on details of the computing environment, including the computer hardware, operating system, and implementation language. Note that numerical outcomes for c0/c1 acquired in one setting don't really apply to another.&amp;lt;br/&amp;gt;&lt;br /&gt;
There is no settled guideline for how substantial a productivity enhancement must be to make it worth utilizing. In a few settings, for example, rendering PC illustrations for enlivened movies, where a large number of CPUs are kept occupied for a considerable length of time, a 10% enhancement (i.e., E = 1.1) brings important reserve funds. In different settings, for example, an irregular calculation, a 60-overlap gain (i.e., E = 60) which transforms a one-minute pause into a one second pause, may not justify the expense of programming a more complicated solution. &amp;lt;br/&amp;gt;&lt;br /&gt;
Computation costs so much less than human effort that we commonly require substantial proficiency gains to counterbalance the time spent programming up a variance decrease. The force to search out a productivity enhancement may possibly come when we end up hanging tight quite a while for an outcome, as, when we have to put our whole Monte Carlo figuring inside a loop representing numerous variations of the issue. A very slow computation costs more than just the computer’s time. It may waste time for those waiting for the answer (workforce). Also, slow computations reduce the number of alternatives that one can explore and thus not giving as options to choose from which would be preferable in many situations. &amp;lt;br/&amp;gt;&lt;br /&gt;
The effectiveness increase important to justify using a method is less if the programming exertion can be amortized over numerous applications. The edge is very high for a one-time program, lower for something that we are adding to our personal library, lower still for code to share with a few associates and even lower for code to be put into a library or simulation tool for general use. Important is to note that all of the methods mentioned in previous chapter are capable of a great range of efficiency improvements.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Recommended reading =&lt;br /&gt;
&lt;br /&gt;
https://web.maths.unsw.edu.au/~zdravkobotev/variancereductionCorrection.pdf&lt;br /&gt;
http://sas.uwaterloo.ca/~dlmcleis/s906/chapt4.pdf&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-mathematical-foundations/variance-and-standard-deviation&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/variance-reduction-methods&lt;br /&gt;
https://www.scratchapixel.com/lessons/mathematics-physics-for-computer-graphics/monte-carlo-methods-in-practice/introduction-quasi-monte-carlo&lt;br /&gt;
https://www0.gsb.columbia.edu/mygsb/faculty/research/pubfiles/4261/glasserman_yao_guidelines.pdf&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=16998</id>
		<title>Optimal size of HDD for virtual Digitization server</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=16998"/>
		<updated>2019-01-19T14:44:31Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Proper usage of server space and capacity is very important for companies these days as the volume of data gathered and produced is growing rapidly and is essential for proper operation of modern companies.&lt;br /&gt;
This simulation is designed to calculate optimal HDD size for a server which is used for processing documents and is based on real data obtained from a company production server.&lt;br /&gt;
&lt;br /&gt;
=Problem definition=&lt;br /&gt;
The simulation is based on data gathered by a server application in database, observations of the server (mainly focused on batch count and their size) and additional information about the solution running on the server gathered from documentation:&lt;br /&gt;
*Processing takes place only on work days&lt;br /&gt;
*Every document scanned to the server is processed by a digitization application which creates batch that contains original scanned document, extracted data in XML files, log files, enhanced images and searchable PDF&lt;br /&gt;
*Application saves all important information about batches in database&lt;br /&gt;
*Backup images from scanning will stay on the server for 6 months (those are additional ~50 % of the batch size) and are in separate folder from the batch folders&lt;br /&gt;
*Successfully processed batches older than 14 days are deleted every day by another application that also produces log files about the successful/failed deletion&lt;br /&gt;
*For precaution let’s assume 5% of batches could fail to be processed correctly (however in obtained sample all batches were processed correctly)&lt;br /&gt;
**Those will stay on the server and will be processed every 6 months by admins when deleting backup&lt;br /&gt;
&lt;br /&gt;
==Observation==&lt;br /&gt;
First observation was made to assess the data available and to decide about proper approach when designing the simulation. &lt;br /&gt;
Information gathered during observation:&lt;br /&gt;
*Each day an average of 17 batches were processed by the server with average size per batch of 24 MB&lt;br /&gt;
*The number of batches changes a lot and can’t be easily predicted so it will have to be taken into consideration&lt;br /&gt;
*Information about deleted batches can be found in database on the server&lt;br /&gt;
&lt;br /&gt;
==Simulation environment==&lt;br /&gt;
MS Excel 2016&lt;br /&gt;
==Simulation method==&lt;br /&gt;
Monte Carlo&lt;br /&gt;
&lt;br /&gt;
=Obtaining real data=&lt;br /&gt;
The data for simulation was extracted from a database which contains information about all the batches that were processed on the server during the last 65 working days. Total of 1124 batches were processed during those days. Important part of the database table needed for simulation is included in the MS Excel file. &lt;br /&gt;
&lt;br /&gt;
=Derivation of probability distributions=&lt;br /&gt;
After the data was gathered and analyzed through a contingency table, graphs were made to display the average batch size (in bins with increment of 5000 KB) and the average batch count per day. Both those graphs are from the log-normal distribution and so the random values were generated based on those distributions for average batch size as well as the average batch count.&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution1.png|Number o batches in size bins (batch size range of 5000 KB, average)]]&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution2.png|Number of different batch count occurances (average)]]&lt;br /&gt;
&lt;br /&gt;
=Simulation=&lt;br /&gt;
For the simulation 132 working days (6 months) were considered as the time before backup deletion and error fix-up takes place. For both average batch size and average batch count random values were generated from the log-normal distribution based on scaled mean (m) and standard deviation (s) of the original data set.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those random values were generated 132 times and then multiplied. After multiplication of those 2 values followed calculating the error and backup size and the cumulative size which was reduced each step starting at 10 steps (14 days for deletion of the oldest batch). Overall size after 6 months was used in excel data table to generate this simulation 1000 times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Results=&lt;br /&gt;
After generating 1000 simulations the AVG, highest and lowest space needed was calculated and is displayed in table below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+1000 simulations results&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|In KB&lt;br /&gt;
|In MB&lt;br /&gt;
|In GB&lt;br /&gt;
|-&lt;br /&gt;
|'''AVG Space needed:'''&lt;br /&gt;
|35189448.7&lt;br /&gt;
|34364.7&lt;br /&gt;
|33.55927&lt;br /&gt;
|-&lt;br /&gt;
|'''Highest space needed:'''&lt;br /&gt;
|105577213&lt;br /&gt;
|103102.7&lt;br /&gt;
|100.6863&lt;br /&gt;
|-&lt;br /&gt;
|'''Lowest space needed:'''&lt;br /&gt;
|21607404.9&lt;br /&gt;
|21100.98&lt;br /&gt;
|20.60643&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Issue with the results is that the highest space needed changes a lot (because the batch size and count changes a lot as was mentioned at the beginning of the paper) even when running the simulation 1000 times. It had to be taken into consideration when deriving conclusions.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
One option for the company when deciding how much space should be reserved for document processing based on the simulation would be to take into consideration the highest space needed from 1000 simulations which is nearly 101 GB. Second recommendation, when using this option, would be to monitor the server at least once a month as the highest value varies a lot and adjust the size if needed. Upside of this approach is that it requires less initial work.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Due to high variance another approach for defining the space needed is to consider only the average space needed so the HDD would have “only” 34 GB free space starting each 6 months. However, when using this approach, if the HDD starts getting full, increasing the size automatically based on the last month when backup deletion took place is necessary. Upside of this solution is proper space utilization as most of the time big part of disk space would be unused if one considers only the highest size needed (based on the average space needed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code=&lt;br /&gt;
&lt;br /&gt;
The Excel file with simulation can be found here:&lt;br /&gt;
https://app.box.com/s/duj71rtgvf4g1u9gi011tcib2umnjdil&lt;br /&gt;
&lt;br /&gt;
[[File:dolj04_Optimal size of HDD for virtual Digitization server.xlsx]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=16958</id>
		<title>Optimal size of HDD for virtual Digitization server</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=16958"/>
		<updated>2019-01-18T16:26:22Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Proper usage of server space and capacity is very important for companies these days as the volume of data gathered and produced is growing rapidly and is essential for proper operation of modern companies.&lt;br /&gt;
This simulation is designed to calculate optimal HDD size for a server which is used for processing documents and is based on real data obtained from a company production server.&lt;br /&gt;
&lt;br /&gt;
=Problem definition=&lt;br /&gt;
The simulation is based on data gathered by a server application in database, observations of the server (mainly focused on batch count and their size) and additional information about the solution running on the server gathered from documentation:&lt;br /&gt;
*Processing takes place only on work days&lt;br /&gt;
*Every document scanned to the server is processed by a digitization application which creates batch that contains original scanned document, extracted data in XML files, log files, enhanced images and searchable PDF&lt;br /&gt;
*Application saves all important information about batches in database&lt;br /&gt;
*Backup images from scanning will stay on the server for 6 months (those are additional ~50 % of the batch size) and are in separate folder from the batch folders&lt;br /&gt;
*Successfully processed batches older than 14 days are deleted every day by another application that also produces log files about the successful/failed deletion&lt;br /&gt;
*For precaution let’s assume 5% of batches could fail to be processed correctly (however in obtained sample all batches were processed correctly)&lt;br /&gt;
**Those will stay on the server and will be processed every 6 months by admins when deleting backup&lt;br /&gt;
&lt;br /&gt;
==Observation==&lt;br /&gt;
First observation was made to assess the data available and to decide about proper approach when designing the simulation. &lt;br /&gt;
Information gathered during observation:&lt;br /&gt;
*Each day an average of 17 batches were processed by the server with average size per batch of 24 MB&lt;br /&gt;
*The number of batches changes a lot and can’t be easily predicted so it will have to be taken into consideration&lt;br /&gt;
*Information about deleted batches can be found in database on the server&lt;br /&gt;
&lt;br /&gt;
==Simulation environment==&lt;br /&gt;
MS Excel 2016&lt;br /&gt;
==Simulation method==&lt;br /&gt;
Monte Carlo&lt;br /&gt;
&lt;br /&gt;
=Obtaining real data=&lt;br /&gt;
The data for simulation was extracted from a database which contains information about all the batches that were processed on the server during the last 65 working days. Total of 1124 batches were processed during those days. Important part of the database table needed for simulation is included in the MS Excel file. &lt;br /&gt;
&lt;br /&gt;
=Derivation of probability distributions=&lt;br /&gt;
After the data was gathered and analyzed through a contingency table, graphs were made to display the average batch size (in bins with increment of 5000 KB) and the average batch count per day. Both those graphs are from the log-normal distribution and so the random values were generated based on those distributions for average batch size as well as the average batch count.&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution1.png|Number o batches in size bins (batch size range of 5000 KB, average)]]&lt;br /&gt;
&lt;br /&gt;
[[File:lognormaldistribution2.png|Number of different batch count occurances (average)]]&lt;br /&gt;
&lt;br /&gt;
=Simulation=&lt;br /&gt;
For the simulation 132 working days (6 months) were considered as the time before backup deletion and error fix-up takes place. For both average batch size and average batch count random values were generated from the log-normal distribution based on scaled mean (m) and standard deviation (s) of the original data set.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those random values were generated 132 times and then multiplied. After multiplication of those 2 values followed calculating the error and backup size and the cumulative size which was reduced each step starting at 10 steps (14 days for deletion of the oldest batch). Overall size after 6 months was used in excel data table to generate this simulation 1000 times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Results=&lt;br /&gt;
After generating 1000 simulations the AVG, highest and lowest space needed was calculated and is displayed in table below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+1000 simulations results&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|In KB&lt;br /&gt;
|In MB&lt;br /&gt;
|In GB&lt;br /&gt;
|-&lt;br /&gt;
|'''AVG Space needed:'''&lt;br /&gt;
|35189448.7&lt;br /&gt;
|34364.7&lt;br /&gt;
|33.55927&lt;br /&gt;
|-&lt;br /&gt;
|'''Highest space needed:'''&lt;br /&gt;
|105577213&lt;br /&gt;
|103102.7&lt;br /&gt;
|100.6863&lt;br /&gt;
|-&lt;br /&gt;
|'''Lowest space needed:'''&lt;br /&gt;
|21607404.9&lt;br /&gt;
|21100.98&lt;br /&gt;
|20.60643&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Issue with the results is that the highest space needed changes a lot (because the batch size and count changes a lot as was mentioned at the beginning of the paper) even when running the simulation 1000 times. It had to be taken into consideration when deriving conclusions.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
One option for the company when deciding how much space should be reserved for document processing based on the simulation would be to take into consideration the highest space needed from 1000 simulations which is nearly 101 GB. Second recommendation, when using this option, would be to monitor the server at least once a month as the highest value varies a lot and adjust the size if needed. Upside of this approach is that it requires less initial work.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Due to high variance another approach for defining the space needed is to consider only the average space needed so the HDD would have “only” 34 GB free space starting each 6 months. However, when using this approach, if the HDD starts getting full, increasing the size automatically based on the last month when backup deletion took place is necessary. Upside of this solution is proper space utilization as most of the time big part of disk space would be unused if one considers only the highest size needed (based on the average space needed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code=&lt;br /&gt;
&lt;br /&gt;
[[File:dolj04_Optimal size of HDD for virtual Digitization server.xlsx]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=User:Dolj04&amp;diff=16957</id>
		<title>User:Dolj04</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=User:Dolj04&amp;diff=16957"/>
		<updated>2019-01-18T16:18:18Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: Created page with &amp;quot;File:lognormaldistribution1.png&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:lognormaldistribution1.png]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=16956</id>
		<title>Optimal size of HDD for virtual Digitization server</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Optimal_size_of_HDD_for_virtual_Digitization_server&amp;diff=16956"/>
		<updated>2019-01-18T16:12:53Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: Monte carlo simulation - Calculating optimal size of HDD for virtual Digitization server&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=Introduction=&lt;br /&gt;
&lt;br /&gt;
Proper usage of server space and capacity is very important for companies these days as the volume of data gathered and produced is growing rapidly and is essential for proper operation of modern companies.&lt;br /&gt;
This simulation is designed to calculate optimal HDD size for a server which is used for processing documents and is based on real data obtained from a company production server.&lt;br /&gt;
&lt;br /&gt;
=Problem definition=&lt;br /&gt;
The simulation is based on data gathered by a server application in database, observations of the server (mainly focused on batch count and their size) and additional information about the solution running on the server gathered from documentation:&lt;br /&gt;
*Processing takes place only on work days&lt;br /&gt;
*Every document scanned to the server is processed by a digitization application which creates batch that contains original scanned document, extracted data in XML files, log files, enhanced images and searchable PDF&lt;br /&gt;
*Application saves all important information about batches in database&lt;br /&gt;
*Backup images from scanning will stay on the server for 6 months (those are additional ~50 % of the batch size) and are in separate folder from the batch folders&lt;br /&gt;
*Successfully processed batches older than 14 days are deleted every day by another application that also produces log files about the successful/failed deletion&lt;br /&gt;
*For precaution let’s assume 5% of batches could fail to be processed correctly (however in obtained sample all batches were processed correctly)&lt;br /&gt;
**Those will stay on the server and will be processed every 6 months by admins when deleting backup&lt;br /&gt;
&lt;br /&gt;
==Observation==&lt;br /&gt;
First observation was made to assess the data available and to decide about proper approach when designing the simulation. &lt;br /&gt;
Information gathered during observation:&lt;br /&gt;
*Each day an average of 17 batches were processed by the server with average size per batch of 24 MB&lt;br /&gt;
*The number of batches changes a lot and can’t be easily predicted so it will have to be taken into consideration&lt;br /&gt;
*Information about deleted batches can be found in database on the server&lt;br /&gt;
&lt;br /&gt;
==Simulation environment==&lt;br /&gt;
MS Excel 2016&lt;br /&gt;
==Simulation method==&lt;br /&gt;
Monte Carlo&lt;br /&gt;
&lt;br /&gt;
=Obtaining real data=&lt;br /&gt;
The data for simulation was extracted from a database which contains information about all the batches that were processed on the server during the last 65 working days. Total of 1124 batches were processed during those days. Important part of the database table needed for simulation is included in the MS Excel file. &lt;br /&gt;
&lt;br /&gt;
=Derivation of probability distributions=&lt;br /&gt;
After the data was gathered and analyzed through a contingency table, graphs were made to display the average batch size (in bins with increment of 5000 KB) and the average batch count per day. Both those graphs are from the lognormal distribution and so the random values were generated based on those distributions for average batch size as well as the average batch count.&lt;br /&gt;
&lt;br /&gt;
[[File:BatchesGraph1.jpg|Number o batches in size bins (batch size range of 5000 KB, average)]]&lt;br /&gt;
&lt;br /&gt;
[[File:BatchesGraph2.jpg|Number of different batch count occurances (average)]]&lt;br /&gt;
&lt;br /&gt;
=Simulation=&lt;br /&gt;
For the simulation 132 working days (6 months) were considered as the time before backup deletion and error fixup takes place. For both average batch size and average batch count random values were generated from the lognormal distribution based on scaled mean (m) and standard deviation (s) of the original data set.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Those random values were generated 132 times and then multiplied. After multiplication of those 2 values followed calculating the error and backup size and the cumulative size which was reduced each step starting at 10 steps (14 days for deletion of the oldest batch). Overall size after 6 months was used in excel data table to generate this simulation 1000 times.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Results=&lt;br /&gt;
After generating 1000 simulations the AVG, highest and lowest space needed was calculated and is displayed in table below:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+1000 simulations results&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|In KB&lt;br /&gt;
|In MB&lt;br /&gt;
|In GB&lt;br /&gt;
|-&lt;br /&gt;
|'''AVG Space needed:'''&lt;br /&gt;
|35189448.7&lt;br /&gt;
|34364.7&lt;br /&gt;
|33.55927&lt;br /&gt;
|-&lt;br /&gt;
|'''Highest space needed:'''&lt;br /&gt;
|105577213&lt;br /&gt;
|103102.7&lt;br /&gt;
|100.6863&lt;br /&gt;
|-&lt;br /&gt;
|'''Lowest space needed:'''&lt;br /&gt;
|21607404.9&lt;br /&gt;
|21100.98&lt;br /&gt;
|20.60643&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Issue with the results is that the highest space needed changes a lot (because the batch size and count changes a lot as was mentioned at the beginning of the paper) even when running the simulation 1000 times. It had to be taken into consideration when deriving conclusions.&lt;br /&gt;
&lt;br /&gt;
=Conclusion=&lt;br /&gt;
One option for the company when deciding how much space should be reserved for document processing based on the simulation would be to take into consideration the highest space needed from 1000 simulations which is nearly 101 GB. Second recommendation, when using this option, would be to monitor the server at least once a month as the highest value varies a lot and adjust the size if needed. Upside of this approach is that it requires less initial work.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
Due to high variance another approach for defining the space needed is to consider only the average space needed so the HDD would have “only” 34 GB free space starting each 6 months. However, when using this approach, if the HDD starts getting full, increasing the size automatically based on the last month when backup deletion took place is necessary. Upside of this solution is proper space utilization as most of the time big part of disk space would be unused if one considers only the highest size needed (based on the average space needed).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Code=&lt;br /&gt;
&lt;br /&gt;
[[File:dolj04_Optimal size of HDD for virtual Digitization server.xlsx]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=WS_2018/2019&amp;diff=16955</id>
		<title>WS 2018/2019</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=WS_2018/2019&amp;diff=16955"/>
		<updated>2019-01-18T15:50:33Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: /* Simulations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Semestral papers from winter term 2018/2019. Please, put here links to the pages with your paper. First you need to have your [[Assignments WS 2018/2019|assignment approved]]&lt;br /&gt;
&lt;br /&gt;
==Simulations==&lt;br /&gt;
&lt;br /&gt;
--[[User:xvegm00|xvegm00]] [[User:Xvegm00|Xvegm00]] ([[User talk:Xvegm00|talk]]) 22:13, 8 January 2019 (CET) [[Simulation of semi-intelligent algae]]&lt;br /&gt;
&lt;br /&gt;
-- Jan Doležálek [[User:Dolj04|Dolj04]] ([[User talk:Dolj04|talk]]) 16:50, 18 January 2019 (CET) [[Optimal size of HDD for virtual Digitization server]]&lt;br /&gt;
&lt;br /&gt;
==Papers==&lt;br /&gt;
-- [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 20:43, 12 January 2019 (CET) [https://en.wikipedia.org/wiki/Data_flow_diagram Complete redo of DFD wikipedia]~&lt;br /&gt;
&lt;br /&gt;
-- [[User:Xvegm00|Xvegm00]] ([[User talk:Xvegm00|talk]]) 10:44, 17 January 2019 (CET)  [[http://www.simulace.info/index.php/Multi-agent_systems Multi-agent systems]]&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Assignments_WS_2018/2019&amp;diff=16749</id>
		<title>Assignments WS 2018/2019</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Assignments_WS_2018/2019&amp;diff=16749"/>
		<updated>2018-12-19T22:23:17Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Ambox&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
Please, put here your assignments. Do not forget to sign them. You can use &amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt; (four tildas) for an automatic signature. Use Show preview in order to check the result before your final sumbition.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Ambox&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
Please, strive to formulate your assignment carefully. We expect an adequate effort to formulate the assignment as it is your semestral paper. Do not forget that your main goal is a research paper. It means your simulation model must generate the results that are specific, measurable and verifiable. Think twice how you will develop your model, which entities you will use, draw a model diagram, consider what you will measure. No sooner than when you have a good idea about the model, submit your assignment. And of course, read [[How to deal with the simulation assignment|How to deal with the simulation assignment]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Ambox&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
Topics on gambling, cards, etc. are not welcome.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Ambox&lt;br /&gt;
| type  = content&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
In order to avoid possible confusion, please, check if you have added '''approved''' in bold somewhere in our comment under your submission. If there is no '''approved''', it means the assignment was not approved yet.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Xvegm00|Xvegm00]]&lt;br /&gt;
&lt;br /&gt;
[[Xkorj58|Xkorj58 (not approved yet)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal (dolj04) ==&lt;br /&gt;
&lt;br /&gt;
Topic/goal: '''Optimal size of HDD for virtual Digitization server'''&lt;br /&gt;
&lt;br /&gt;
Definition of the problem: &amp;lt;br/&amp;gt;&lt;br /&gt;
- each day an average of 47 batches of documents is being processed by the server with average size per batch of 32 MB (calculated from customers server)&amp;lt;br/&amp;gt;&lt;br /&gt;
- the number of batches changes a lot and cant be easily predicted so it will have to be taken into consideration (from sample: lowest number of batches scanned in a day is 13, the highest is 134)&amp;lt;br/&amp;gt;&lt;br /&gt;
- the average size is not changing that much&amp;lt;br/&amp;gt;&lt;br /&gt;
- (batch contains original scanned documents, extracted data in XML files, log files, enhanced images and searchable PDF)&amp;lt;br/&amp;gt;&lt;br /&gt;
- backup images from scanning will stay on the server for 6 months (those are ''additional'' ~50 % of the batch size)&amp;lt;br/&amp;gt;&lt;br /&gt;
- successfully processed batches older than 14 days are deleted every day&amp;lt;br/&amp;gt;&lt;br /&gt;
- for precaution lets say around 5% of batches wont be processed correctly&amp;lt;br/&amp;gt;&lt;br /&gt;
	- those will stay on the server and will be processed every month by admins &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simulation environment: Vensim&lt;br /&gt;
&lt;br /&gt;
:: on what data you will base the simulation? I do not see any causal loops in the issue you are trying to solve, using Vesim does not make much sense then- this topic suits the Monte Carlo if you have the data to derive the parameters from. [[User:Oleg.Svatos|Oleg.Svatos]] ([[User talk:Oleg.Svatos|talk]]) 22:38, 18 December 2018 (CET)&lt;br /&gt;
&lt;br /&gt;
:::: I would like to take the data at work as I have access to production server which is used by one of our customers for digitization and I will use Monte Carlo as you suggested.&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal (svem02 [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 18:42, 18 December 2018 (CET)) ==&lt;br /&gt;
&lt;br /&gt;
Topic: '''likelihood of infection with flu'''&lt;br /&gt;
&lt;br /&gt;
Definition of the problem: &amp;lt;br/&amp;gt;&lt;br /&gt;
- everyone has a certain probability of getting sick with a flu, this model calculates the probability based on the people you are in contact with (two types of people, infected, not infected). Other variables and levels are available (e.g. infestation, total population&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simulation environment: Vensim&lt;br /&gt;
&lt;br /&gt;
:: on what data you would set up the simulation? how would you simulate the individual people and their connection in Vensim? (in my opinon this topic fits multiagent simulation) [[User:Oleg.Svatos|Oleg.Svatos]] ([[User talk:Oleg.Svatos|talk]]) 22:30, 18 December 2018 (CET)&lt;br /&gt;
&lt;br /&gt;
:::: I would base the simulation on how much one person interacts with others, depending on this variable the person would have some probability of getting sick thus the number of ill people would increase thus the probability of him getting sick would be higher and higher. The variable infestation would represent how much the illness is easily transimited to other people. [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 14:04, 19 December 2018 (CET)&lt;br /&gt;
:::::: I do not see it as simulation - not much of randomness, no causal feedback loops and pretty obvious result (the longer the simulation would run, the more sick people or that one gets sick) with no practical use. Not to mention, there is no data to derive the equations needed. Either reformulate it for the Netlogo so that it has some useful results based on some real data, or try something else. [[User:Oleg.Svatos|Oleg.Svatos]] ([[User talk:Oleg.Svatos|talk]]) 14:27, 19 December 2018 (CET)&lt;br /&gt;
:::::::: Ok, I will try something else. New proposal at the bottom of the page [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 16:46, 19 December 2018 (CET)&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal ([[User:xkaij00|xkaij00]] ([[User talk:xkaij00|talk]]) 21:20, 18 December 2018 (CET)) ''(Not approved yet)'' ==&lt;br /&gt;
&lt;br /&gt;
Topic: '''Social and economical effects of reunification of North &amp;amp; South Korea''' &amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Definition of the problem:''' &amp;lt;br/&amp;gt;&lt;br /&gt;
Let's hope one day South and North Korea will be reunited. That would mean a big fluctuation of people between the two separated states: &amp;lt;br/&amp;gt;&lt;br /&gt;
- North Koreans will migrate to South Korea area, look for flats, try to get jobs and receive welfare. &amp;lt;br/&amp;gt;&lt;br /&gt;
- South Koreans will invest in North Korea area and create jobs and factories there. &amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
''I would like to simulate:'' &amp;lt;br/&amp;gt;&lt;br /&gt;
- What will be the population ratio of the two areas per square meter. &amp;lt;br/&amp;gt;&lt;br /&gt;
- How many North Koreans will move to South Korea area after the reunification and how many of them will be on welfare and how much that will cost the new reunited country. &amp;lt;br/&amp;gt;&lt;br /&gt;
- How much will the suicide rate change in Korea after the reunification since it's a known fact that defected North Koreans have a high suicide rate due to the fact they have difficulties to adjust to the new lifestyle and process propaganda-free information. &amp;lt;br/&amp;gt;&lt;br /&gt;
- What will be the housing situation after the reunification. &amp;lt;br/&amp;gt;&lt;br /&gt;
- How will the GDP of the new country possibly develop. &amp;lt;br/&amp;gt;&lt;br /&gt;
- Possibly how much money will be needed from international help. &amp;lt;br/&amp;gt; &amp;lt;br/&amp;gt;&lt;br /&gt;
'''Simulation environment:''' NetLogo&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
: I must say it is a really interesting topic, but I am afraid it is a bit too ambitious. Please, if you are interested in this topic, elaborate in detail, how you would solve it. What agents would you use, what parameters, how the simulation would look like, on what data it should be based (and where you get them). And perhaps focus on fewer goals. To be honest, I am still not sure if this is doable, because of the need for extensive research. But, try to think about it yourself. [[User:Tomáš|Tomáš]] ([[User talk:Tomáš|talk]]) 19:26, 19 December 2018 (CET)&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal (bobj00) ([[User:Bobrekjiri|Bobrekjiri]] ([[User talk:Bobrekjiri|talk]]) 13:49, 19 December 2018 (CET)) ''(Not approved yet)'' ==&lt;br /&gt;
&lt;br /&gt;
Topic/goal: '''Comparing the efficiency of Diamond interchange and Diverging diamond interchange'''&lt;br /&gt;
&lt;br /&gt;
'''Definition of the problem:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
- [https://en.wikipedia.org/wiki/Diverging_diamond_interchange Diverging diamond interchange] is an alternative to Diamond interchange that is being used in France since 1970s and was brought to light recently (2009) in USA because it should be more effective than Diamond interchange in terms of waiting times and also in terms of safety (fewer crossing points of traffic).&amp;lt;br/&amp;gt;&lt;br /&gt;
- Goal of the simulation is to measure if the statement about lower waiting times is correct and under which conditions (traffic load, traffic lights setup).&amp;lt;br/&amp;gt;&lt;br /&gt;
- Throughput and waiting times will be measured under several traffic conditions, for example: most cars exiting highway are heading south or most cars entering highway are heading west, etc.&amp;lt;br/&amp;gt;&lt;br /&gt;
- Model does not include simulation of traffic accidents, so the safety cannot be measured and will not be part of the simulation.&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Simulation environment:''' Netlogo&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal [[User:Martin svejda|Martin svejda]] ([[User talk:Martin svejda|talk]]) 16:52, 19 December 2018 (CET) ==&lt;br /&gt;
&lt;br /&gt;
Topic/goal: '''Maze runner vs fire'''&lt;br /&gt;
&lt;br /&gt;
'''Definition of the problem:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
- There will be a maze, in one corner a person, who tries to find the way out, in the other corner will be fire spreading rapidly. Does the person survives or dies by fire? Person and fire wont be able to jump through walls.&lt;br /&gt;
&lt;br /&gt;
'''Simulation environment''': Netlogo&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==Simulation proposal [[User:qnesa01|qnesa01]] ''(Not approved yet)'' ==&lt;br /&gt;
&lt;br /&gt;
Topic/goal: '''Traffic simulation Argentinska street'''&lt;br /&gt;
&lt;br /&gt;
'''Situation:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
- Argentinska street is one of the important roads in Prague that connects Bubenské nábřeží with bridge “Barikádníků”. It leads from city centre and other parts of city outside to the northern part of the country, and to Germany or Poland. Moreover, Argentinska street connects hospital “Na Bulovce” with city centre and other parts. For emergency vehicles it is the way how to get faster, where help is needed.  &lt;br /&gt;
&lt;br /&gt;
'''Definition of the problem:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
- There is traffic on the road during mornings and evenings, which makes people wait sometimes hours to get out and more important it makes difficult pass for emergency vehicles. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Purpose of simulation:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
In the scope is part of Argentinska street from Bubenské nábřeží till Dělnická street plus street Za Viaduktem, part of Jateční and part of Tusarova street as they have influence on the whole situation of Argentinska traffic. The purpose of the simulation is to find ways how to make traffic less. In order to do it will be checked, first, if it is possible to change lights more efficiently for cars flow. Second, answer the question – if we can add only one line only to one direction, which direction we have to choose: to city centre or from city centre?  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Simulation environment''': Simprocess; SUMO (for traffic representation) &lt;br /&gt;
&lt;br /&gt;
'''Brief process of simulation :'''&amp;lt;br/&amp;gt;&lt;br /&gt;
1)	Data collection. Data will be collected manually (observation) and from HERE traffic API. Manually for morning, midday and evening during 30 mins each part of the day within one week. At the end of data collecting the average distribution will be made based on the data. &lt;br /&gt;
2)	Real situation simulation &lt;br /&gt;
3)	Based on simulation of real situation will be checked the efficiency of lights changes &lt;br /&gt;
4)	The hypothetical model of adding one more line will be created based on simulation of real situation &lt;br /&gt;
5)	Summary&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal [[User:Kadj02|Kadj02]] ([[User talk:Kadj02|talk]]) (Jindřich Kadoun) 18:52, 19 December 2018 (CET) ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Topic/goal: '''Survival of the apocalypse'''&lt;br /&gt;
&lt;br /&gt;
'''Definition of the problem:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
- This simulation would aim to showcase in what conditions can humanity survive in the zombie-apocalyptic scenario. &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The usual scenario in which zombie appears is very simple: there are some number of patiants zero and the rules&lt;br /&gt;
for spreading the plague is to get bitten by the infected. There is also a percantual chance of beeing immune against&lt;br /&gt;
the plague. Zombies are usually slower than human beeings and behave on the basic of their nearest vision. &lt;br /&gt;
&lt;br /&gt;
Numerous factors can be acounted for survival, like ability for humanity to reproduce, their number, immunity,&lt;br /&gt;
effectivnes of the plague.&lt;br /&gt;
&lt;br /&gt;
'''Simulation environment''': Netlogo&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal [[User:Xlazl00|Xlazl00]] ([[User talk:Xlazl00|talk]]) 22:33, 19 December 2018 (CET) ==&lt;br /&gt;
&lt;br /&gt;
Topic/goal: '''Medieval Battle Simulation'''&lt;br /&gt;
&lt;br /&gt;
'''Definition of the problem:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Two kingdoms come to a dispute and after extensive diplomacy had failed, they take up arms and go to battle.&amp;lt;br/&amp;gt;&lt;br /&gt;
Each kingdom can have different number of units, but they each choose from the same kind of units (unit types are better against some and weaker to other).&amp;lt;br/&amp;gt;&lt;br /&gt;
Each side has their own staging area, but within that area the units can spawn at random locations to test different strategic formations.&amp;lt;br/&amp;gt;&lt;br /&gt;
When they meet in battle, they fight to the last man who wins the dispute for his king.&amp;lt;/br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Purpose of simulation:'''&amp;lt;br/&amp;gt;&lt;br /&gt;
It simulates medieval combat on battlefield between two sides.&amp;lt;br/&amp;gt;&lt;br /&gt;
The user can select which type of units and how many will each kingdom have.&amp;lt;br/&amp;gt;&lt;br /&gt;
Repeated simulation can lead to conclusions on what strategy the kings should focus on and which units they should train for successful reign when facing a violent foe.&lt;br /&gt;
&lt;br /&gt;
'''Simulation environment:''' NetLogo&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
	<entry>
		<id>http://www.simulace.info/index.php?title=Assignments_WS_2018/2019&amp;diff=16710</id>
		<title>Assignments WS 2018/2019</title>
		<link rel="alternate" type="text/html" href="http://www.simulace.info/index.php?title=Assignments_WS_2018/2019&amp;diff=16710"/>
		<updated>2018-12-17T14:56:26Z</updated>

		<summary type="html">&lt;p&gt;Dolj04: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Ambox&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
Please, put here your assignments. Do not forget to sign them. You can use &amp;lt;nowiki&amp;gt;~~~~&amp;lt;/nowiki&amp;gt; (four tildas) for an automatic signature. Use Show preview in order to check the result before your final sumbition.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Ambox&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
Please, strive to formulate your assignment carefully. We expect an adequate effort to formulate the assignment as it is your semestral paper. Do not forget that your main goal is a research paper. It means your simulation model must generate the results that are specific, measurable and verifiable. Think twice how you will develop your model, which entities you will use, draw a model diagram, consider what you will measure. No sooner than when you have a good idea about the model, submit your assignment. And of course, read [[How to deal with the simulation assignment|How to deal with the simulation assignment]].&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Ambox&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
Topics on gambling, cards, etc. are not welcome.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Ambox&lt;br /&gt;
| type  = content&lt;br /&gt;
| text  = &amp;lt;div&amp;gt;&lt;br /&gt;
In order to avoid possible confusion, please, check if you have added '''approved''' in bold somewhere in our comment under your submission. If there is no '''approved''', it means the assignment was not approved yet.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Xvegm00|Xvegm00]]&lt;br /&gt;
&lt;br /&gt;
[[Xkorj58|Xkorj58]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Simulation proposal (dolj04) ==&lt;br /&gt;
&lt;br /&gt;
Topic/goal: '''Optimal size of HDD for virtual Digitization server'''&lt;br /&gt;
&lt;br /&gt;
Definition of the problem: &amp;lt;br/&amp;gt;&lt;br /&gt;
- each day an average of 47 batches of documents is being processed by the server with average size per batch of 32 MB (calculated from customers server)&amp;lt;br/&amp;gt;&lt;br /&gt;
- the number of batches changes a lot and cant be easily predicted so it will have to be taken into consideration (from sample: lowest number of batches scanned in a day is 13, the highest is 134)&amp;lt;br/&amp;gt;&lt;br /&gt;
- the average size is not changing that much&amp;lt;br/&amp;gt;&lt;br /&gt;
- (batch contains original scanned documents, extracted data in XML files, log files, enhanced images and searchable PDF)&amp;lt;br/&amp;gt;&lt;br /&gt;
- backup images from scanning will stay on the server for 6 months (those are ''additional'' ~50 % of the batch size)&amp;lt;br/&amp;gt;&lt;br /&gt;
- successfully processed batches older than 14 days are deleted every day&amp;lt;br/&amp;gt;&lt;br /&gt;
- for precaution lets say around 5% of batches wont be processed correctly&amp;lt;br/&amp;gt;&lt;br /&gt;
	- those will stay on the server and will be processed every month by admins &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Simulation environment: Vensim&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Dolj04</name></author>
		
	</entry>
</feed>