NormalToyMC

Description

Generates a random sample distributed according to multivariate normal distribution without correlations.

Uses boost::mt19937 random generator.

The sample becomes frozen upon generation. One has to manually taint the transformation for the next sample by calling nextSample method.

Inputs

  1. Average model vector \(\mu_1\).

  2. First model uncertainties vector \(\sigma_1\).

  3. Average model vector \(\mu_2\).

  4. Second model uncertainties vector \(\sigma_2\).

  5. etc.

  6. etc.

Inputs are added via add(theory, sigma) method.

Outputs

  1. 'toymc' — output vector \(x\) of size of concatination of \(\mu_i\).

Implementation

For the random variable vector \(x\) of size \(N\), distributed around \(\mu\) with uncertainties \(\sigma\) the p.d.f. is:

\[P(x|\mu) = \frac{1}{\sqrt{ (2\pi)^N}\prod\limits_i \sigma_i} e^{\displaystyle\frac{1}{2}\sum_i\frac{(x_i-\mu_i)^2}{\sigma^2_i}}.\]

One can define the vector \(z\):

\[\begin{split}&z_i = \frac{x_i-\mu_i}{\sigma_i},\\ &x_i = \sigma_i z_i + \mu_i.\end{split}\]

Since the transition Jacobian \(|dx/dz|=|L|=\prod\limits_i \sigma_i\) each \(z_i\) is distributed normally with \(\sigma=1\) with central value of \(0\).

The algorithm generates normal vector \(z\) and transforms it to \(x_i=\sigma_i z_i + \mu_i\).

By \(\mu\) we mean the concatenation of vectors \(\mu_i\).