McStas logo McStas - A neutron ray-trace simulation package ILL; PSI; ESS Niels Bohr Institute DTU Physics

McStas

About McStas
 Conditions of use
 Authors/Contacts
 Project funding

Download
 Components
 Other Downloads (share)

Mailing list

Search web/mailinglist

Documentation
 Wiki (GitHub)
 McStas manual
 Publications

Links

Report bugs (GitHub)

Code-repository (GitHub)


Accuracy of Monte Carlo simulations

2.5  Accuracy of Monte Carlo simulations

When running a Monte Carlo, the meaningful quantities are obtained by integrating random events into a single value (e.g. flux), or onto an histogram grid. The theory [Jam80] shows that the accuracy of these estimates is a function of the space dimension \(d\) and the number of events \(N\). For large numbers \(N\), the central limit theorem provides an estimate of the relative error as \(1/\sqrt {N}\). However, the exact expression depends on the random distributions.

McStas uses a space with \(d=10\) parameters to describe neutrons (position, velocity, spin, time). We show in Table 2.1 a rough estimate of the accuracy on integrals as a function of the number of records reaching the integration point. This stands both for integrated flux, as well as for histogram bins - for which the number of events per bin should be used for \(N\).




Records Accuracy


\(10^3\) 10 %
\(10^4\) 2.5 %
\(10^5\) 1 %
\(10^6\) 0.25 %
\(10^7\) 0.05 %



Table 2.1.: Accuracy estimate as a function of the number of statistical events used to estimate an integral with McStas.


Last Modified: Tuesday, 06-Oct-2026 21:19:10 CEST
Search website mailinglist archive GitHub repos