McXtrace logo

McXtrace - An X-ray ray-trace simulation package

Synchrotron SOLEIL DTU Physics

McXtrace

About McXtrace
 Publications
 Project Partners
 Project People
 Goal

Download
 Components

Documentation
 Manual
 Commands
 Wiki (GitHub)
 Tutorial

Mailing list

Links

Search

Code-repository (GitHub)

Report bugs (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.

McXtrace uses a space with \(d=12\) parameters to describe x-rays (position, wavevector, weight, polarisation, phase, 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 Accurarcy


\(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 McXtrace.


Last Modified: Monday, 05-Oct-2026 10:48:08 CEST
Search website mailinglist archive GitHub repos