# averaging after n trials of monte carlo simulation or not? which is better statistically?

related to my job I want to code a realistic monte carlo simulation for availability, reliability and related sensitivity analysis. Scenario will be complex and there will be many parameters.

What I want to ask however is I think a basic knowledge for statisticians.

My question is

Assuming both procedures uses same computational resources which procedure below is better by means of statistics discipline and why? What I mean by better is smaller variance from the true value.

Procedure 1)

1. 10K Monte carlo simulations
2. find expected value by using 10K results above
3. repeat step 1 & step 2 10 times. (Now we have 10 expected values)
4. find expected value by averaging result of step 3.

Procedure 2)

1. 100K Monte carlo simulations
2. find expected value by using 100K results above

My question is arived after reading tutorial: http://weibull.com/hotwire/issue3/hottopics3.htm

best regards

Both procedures actually lead to the same answer from a probabilistic perspective, i.e., to the same distribution for the Monte Carlo estimator, since$$\frac{1}{10N}\sum_{i=1}^{10N} f(x_i)\sim\frac{1}{10}\sum_{j=1}^{10} \frac{1}{N}\sum_{k=1}^{N} f(x_{jk})$$ (meaning the two random variables have the same distribution) when $$x_i,x_{jk}\stackrel{\text{i.i.d.}}{\sim} g$$In particular,$$\text{var}\left(\frac{1}{10N}\sum_{i=1}^{10N} f(x_i)\right)=\text{var}\left(\frac{1}{10}\sum_{j=1}^{10} \frac{1}{N}\sum_{k=1}^{N} f(x_{jk})\right)$$

• This only holds for the linear, simpler case. For any kind of non-linear stochastic process, the given expression simply do not hold to be applied. For a dynamical system the inputs for a MC will not be scalars but signals $x_{jk}(t)$ and the distribution wont be a function but systems $f(x_{jk}(t)',x_{jk}(t),t)$. When applied under different subsystems, the $x_{jk}(t)$ random variables wont be iid, in fact, for the most of the conventional cases they will be adjusted properly. The identity will hold at subsystem level though... Commented May 30, 2015 at 17:47
• Besides, for other kind of estimators -for example any weighted average $$y_{est}(t)=\sum_i \alpha_i(f(x_i',x_i,t))$$ applied for assessment of machines will not be linear in principle. Commented May 30, 2015 at 17:52

I prefer to talk here and not in the ~comments~ because it seems to be a long writing. I am not a statistician on discipline :) but here are some proposal aspect for setting up your MC analysis...

Number of Experiments

OF course, the more experiments you try, the better, so, by far, the preferable Procedure would be the first. The ideal would be to distribute as many experiments as possible, because every experiment drive a different operating point of the whole system. Note that the number of points are distributed after the number of experiments were obtained...

The main factors on this decision are:

1. The variability of the expected value you want to obtain,
2. The variability of the process,
3. The quantity of excited subsystems.

Of course, you can escalate this strategy onto sensors, machines, process, facilities, etc... The idea is, the size of the MC is theoretically the variabilities described above.

Variability Here, variability is: non-linearity, dinamical, time-varying.

Evidently if everything is linear -this do not means the systems are linear , but their frequent operating domain is reduced to a small quantity of points- there is no difference between the Procedure 1 and the Procedure 2.

1. A non-linear system-i.e. a pressure control system- or machine will require more MC points than a linear one -i.e. a temperature control system-,
2. A dynamical system -i.e. almost any process- will require more MC points than a static system -i.e. a system output, constant KPIs, monitors-,
3. A time varying system -i.e. event ocurrences, periodic or non periodic trends- will require specific MC points for covering those situations.

Every of these factors carry a particular, well defined, measure of variability as the expected rate of change -flow, energy consumed, activity- per rate of resources consumed -time, fuel, manhours-.

With all this clear, you are free to proceed onto the stages of the overall system analysis, which more or less proceed on this way:

Step 1. Exploration. You dont know anything about your system, and place your MC 100k operating points randomly and you are done,

Step 2. Detection. You need to identify how to distribute those 100k, in order to concentrate your simulation power to cover the most demanded areas,

Step 3. Diagnosis. You obtain reliable estimators and calculate the first variance for your estimators,

Step 4. Isolation. You optimize your simulations and improve the variance for your estimators.

Every system of course will have its own agenda, but as you see, the more complex, the merrier the analysis turned to be...

Well if any comments, just write here below and we extend the discussion.

Cheers...

• Actually source link I gave is a known trade in reliability engineering. Your answer support their choice (procedure 1) and gives lots of extra valuable info. Thank you very much madam. Commented May 30, 2015 at 8:38