Docsity

Error Estimation-Monte Carlo Simulation-Modeling and Simulation-Lecture, Lecture notes of Mathematical Modeling and Simulation

Partial preview of the text

Download Error Estimation-Monte Carlo Simulation-Modeling and Simulation-Lecture and more Lecture notes Mathematical Modeling and Simulation in PDF only on Docsity!

6/23/2012 Nasir M Mirza^1

Monte Carlo Simulation

Room A-114, Department of Physics & Applied Mathematics, Pakistan Institute of Engineering & Applied Sciences, P.O. Nilore, Islamabad email: [email protected]

Dr. Nasir M Mirza

Lecture 16:

Error Estimations

Course: NE-

6/23/2012 Nasir M Mirza^2

Direct error estimation

 Assume that the calculation calls for the

simulation ofN particle histories.

 Assign and accumulate the value xi for the score

associated with thei'th history, where 1 < i< N.

Assign as well the square of the scorex^2 for i’th

history.

 Calculate the mean value ofx:

Assume that x is a quantity we calculate during the course of a Monte Carlo simulation, i.e. a scoring variable or simply a “score" or a \tally".

The output of a Monte Carlo calculation is usually useless unless we can ascribe a probable error to it.

The conventional approach to calculating the estimated error is as follows:

N

i

xi N

x 1

1

6/23/2012 Nasir M Mirza^4

Batch statistics error estimation

It may require a lot of effort to stop after each history and compute the xi 's and x^2. The “direct error estimation" should be considered first and if it is not feasible, then an alternative that is nearly as good is “batch statistics error estimation". We present a procedure here

In many cases, the estimation of means and variances using the methods described in the previous section is not feasible. A score may be a complicated object or there may be many geometrical volume elements to consider.

Split the N histories into n statistical batches of w= N/n histories each. Note that n must be “large enough". A standard choice is n = 30. The accumulated quantity for each of these batches is called sumj as a sum for the j’th batch. The sumj is

 

w

i

sum j xi

1 Then compute the mean value of x

 

n

j

x x N sumj 1

6/23/2012 Nasir M Mirza^5

Discrete Distribution Sampling

Estimate the variance associated with the distribution of the xj :

 

 

  

n

j

j

n

j

x j x x n

x x n

s 1

2 2 1

(^2 2) ( ) 1

1 ( ) 1

1

The estimated variance of x is the standard variance of the mean:

Report the final result as x = < x> ± s().

n

s

s x x

2

Remarks: We use above equations with n fixed (at say, 30) because it gives a reasonable estimate of the error in x.

Any large number will do, as long as we are within the range of applicability of the Central limit theorem. There is some evidence that the calculated statistic depends weakly on the choice of n. Therefore, it is important to report how your statistics were done when you publish your Monte Carlo results.

6/23/2012 Nasir M Mirza^7

The Error

Remarks:

Thus, by sampling the exponential three times

and adding the three values one can sample this

pdf. In general the sum of n such variables of

exponential pdf gives a

n az

n z e n

a w z   

 1 ( 1 )!

( )

This method of combining errors effectively increases

the value of n, the number of statistical batches used in

the calculation. In view of the fact that the calculated

statistics are thought to depend weakly on n, it is

preferable (but only marginally so for the sake of

consistency) to combine thexi's (the raw data) into the

standard number of statistical batches.

This is easy to do by initializing the data arrays to the results of the previous run before the start of a new run.