27 params.
addClassDescription(
"Perform Affine Invariant Ensemble MCMC with differential sampler.");
29 "previous_state",
"Reporter value with the previous state of all the walkers.");
32 "Reporter value with the previous state of all the walkers for variance.");
33 MooseEnum tuning_option(
"Braak2006_static",
"Braak2006_static");
35 "tuning_option", tuning_option,
"The tuning option for internal parameters.");
36 params.
addParam<std::vector<Real>>(
"scales",
"Scales for the parameters.");
42 _previous_state(getReporterValue<
std::vector<
std::vector<
Real>>>(
"previous_state")),
43 _previous_state_var(getReporterValue<
std::vector<
Real>>(
"previous_state_var")),
44 _tuning_option(getParam<
MooseEnum>(
"tuning_option"))
48 "num_parallel_proposals",
49 "At least five parallel proposals should be used for the Differential Evolution Sampler.");
53 "It is recommended that the parallel proposals be greater than or equal to the " 54 "inferred parameters. This will allow the sampler to not get stuck on a hyper-plane.");
58 _scales = getParam<std::vector<Real>>(
"scales");
61 "The number of scales provided should match the number of tunable params.");
69 const Real & state1,
const Real & state2,
const Real & rnd,
const Real & scale, Real & diff)
82 gamma = 2.38 / std::sqrt(2 *
_priors.size());
92 unsigned int index_req1, index_req2;
98 for (
unsigned int i = 0; i <
_priors.size(); ++i)
const MooseEnum & _tuning_option
Tuning options for the internal params.
const unsigned int _num_parallel_proposals
Number of parallel proposals to be made and subApps to be executed.
virtual int decisionStep() const override
Return the step after which decision making can begin.
const std::vector< Real > * _lower_bound
Lower bounds for making the next proposal.
const std::vector< std::vector< Real > > & _previous_state
Reporter value with the previous state of all the walkers.
std::vector< const Distribution * > _priors
Storage for prior distribution objects to be utilized.
static InputParameters validParams()
Real getRand(unsigned int index=0)
void mooseWarning(Args &&... args) const
bool isParamValid(const std::string &name) const
virtual void proposeSamples(const unsigned int seed_value) override
Fill in the _new_samples vector of vectors (happens within sampleSetUp)
std::vector< Real > _new_var_samples
Vector of new proposed variance samples.
const std::vector< Real > & _previous_state_var
Reporter value with the previous state of all the walkers for variance.
void paramError(const std::string ¶m, Args... args) const
void randomIndexPair(const unsigned int &upper_bound, const unsigned int &exclude, const unsigned int &seed, unsigned int &req_index1, unsigned int &req_index2)
Sample two random indices without repitition excluding a specified index.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A class for performing Affine Invariant Ensemble MCMC with differential sampler.
std::vector< std::vector< Real > > _new_samples
Vectors of new proposed samples.
const Distribution * _var_prior
Storage for prior distribution object of the variance to be utilized.
void tuneParams(Real &gamma, Real &b, const Real &scale)
Tune the internal parameters.
AffineInvariantDES(const InputParameters ¶meters)
registerMooseObject("StochasticToolsApp", AffineInvariantDES)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
virtual Real quantile(const Real &y) const=0
virtual Real quantile(const Real &p) const override
std::vector< Real > _scales
Scales for the parameters.
static InputParameters validParams()
void computeDifferential(const Real &state1, const Real &state2, const Real &rnd, const Real &scale, Real &diff)
Compute the differential evolution from the current state.
A base class used to perform Parallel Markov Chain Monte Carlo (MCMC) sampling.