Check if a range of observations have equilibrated.
- Parameters
-
observations | An Eigen::VectorXd of observations |
prec | Desired absolute precision (<X> +/- prec) |
This uses the following algorithm, based on: Van de Walle and Asta, Modelling Simul. Mater. Sci. Eng. 10 (2002) 521–538.
Partition observations into three ranges:
- equilibriation stage: [0, start1)
- first partition: [start1, start2)
second partition: [start2, N)
where N is observations.size(), start1 and start 2 are indices into observations such 0 <= start1 < start2 <= N, the number of elements in the first and second partition are the same (within 1).
We consider the calculation equilibrated at start1 if mean of elements in first and second partition are approximately equal to the desired precsion: (std::abs(mean1 - mean2) < prec).
Additionally, we increment start1 as much as needed to ensure that the equilibriation stage has observations on either side of the total mean.
If these conditions are met, set: m_is_equilibrated = true; m_equil_samples = start1;
If these conditions can not be met, set: m_is_equilibrated = false; m_equil_samples = N-1;
Definition at line 37 of file MCData.cc.