#include <MCData.hh>
Checks if a range of observations have converged.
Definition at line 97 of file MCData.hh.
|
std::tuple< bool, double, double > | _calc_rho (const Eigen::VectorXd &observations) |
| Try to find rho = pow(2.0, -1.0/i), using min i such that CoVar[i]/CoVar[0] <= 0.5. More...
|
|
CASM::MCDataConvergence::MCDataConvergence |
( |
| ) |
|
|
inline |
Default constructor.
Definition at line 105 of file MCData.hh.
CASM::MCDataConvergence::MCDataConvergence |
( |
const Eigen::VectorXd & |
observations, |
|
|
double |
conf |
|
) |
| |
Construct a MCDataConvergence object.
Check convergence of a range of observations.
- Parameters
-
observations | An Eigen::VectorXd of observations |
conf | Desired confidence level |
We check for convergence using the algorithm of: Van de Walle and Asta, Modelling Simul. Mater. Sci. Eng. 10 (2002) 521–538.
The observations are considered converged to the desired prec and conf if:
where:
- calculated_prec = sqrt(Var)*z_alpha,
- z_alpha = sqrt(2.0)*inv_erf(1.0-conf)
- var_of_mean = (CoVar[0]/observations.size())*((1.0+rho)/(1.0-rho))
- CoVar[i] = ( (1.0/(observations.size()-i))*sum_j(j=0:L-i-1, observations(j)*observations(j+1)) ) - sqr(observations.mean());
- rho = pow(2.0, -1.0/i), using min i such that CoVar[i]/CoVar[0] < 0.5
Definition at line 127 of file MCData.cc.
std::tuple< bool, double, double > CASM::MCDataConvergence::_calc_rho |
( |
const Eigen::VectorXd & |
observations | ) |
|
|
private |
Try to find rho = pow(2.0, -1.0/i), using min i such that CoVar[i]/CoVar[0] <= 0.5.
- Returns
- std::tuple<bool, double> : (found_rho?, rho)
Definition at line 165 of file MCData.cc.
double CASM::MCDataConvergence::calculated_precision |
( |
| ) |
const |
|
inline |
Calculated precision of <X>
- Returns
- sqrt(2.0*Var(<X>))*inv_erf(1.0-conf)
- This is the critical value is used for comparison in is_converged
- Var(<X>), the variance in the mean of X, is calculated as described by MCDataConvergence
Definition at line 139 of file MCData.hh.
bool CASM::MCDataConvergence::is_converged |
( |
double |
prec | ) |
const |
|
inline |
double CASM::MCDataConvergence::mean |
( |
| ) |
const |
|
inline |
double CASM::MCDataConvergence::squared_norm |
( |
| ) |
const |
|
inline |
double CASM::MCDataConvergence::m_calculated_prec |
|
private |
bool CASM::MCDataConvergence::m_is_converged |
|
private |
double CASM::MCDataConvergence::m_mean |
|
private |
double CASM::MCDataConvergence::m_squared_norm |
|
private |
The documentation for this class was generated from the following files:
- /Users/bpuchala/Work/codes/CASMcode_v0.2.X_reference/include/casm/monte_carlo/MCData.hh
- /Users/bpuchala/Work/codes/CASMcode_v0.2.X_reference/src/casm/monte_carlo/MCData.cc