18 params.
addClassDescription(
"Perform decision making for independent Metropolis-Hastings MCMC.");
20 "seed_input",
"seed_input",
"The seed vector input for proposing new samples.");
27 _seed_input(declareValue<
std::vector<
Real>>(
"seed_input"))
31 paramError(
"sampler",
"The selected sampler is not of type IndependentGaussianMH.");
42 for (
unsigned int i = 0; i < evidence.size(); ++i)
45 for (
unsigned int j = 0;
j <
_priors.size(); ++
j)
46 evidence[i] += (std::log(
_priors[
j]->pdf(input_matrix(i,
j))) -
57 const std::vector<Real> & evidence)
59 for (
unsigned int i = 0; i < tv.size(); ++i)
60 tv[i] = (1.0 / tv.size()) * std::exp(std::min(evidence[i], 0.0));
62 _tpm_modified.push_back((1.0 - std::accumulate(tv.begin(), tv.end(), 0.0)));
69 const std::vector<Real> & ,
70 const unsigned int & parallel_index)
80 req_inputs[
k] = input_matrix(index,
k);
94 req_inputs[
k] = input_matrix(parallel_index,
k);
dof_id_type _num_confg_values
Storage for the number of experimental configuration values.
PMCMCDecision will help making sample accept/reject decisions in MCMC schemes (for e...
virtual void computeEvidence(std::vector< Real > &evidence, const DenseMatrix< Real > &input_matrix) override
Compute the evidence (aka, betterness of the proposed sample vs the previous)
const IndependentGaussianMH *const _igmh
IndependentGaussianMH sampler.
unsigned int weightedResample(const std::vector< Real > &weights, Real rnd)
return a resampled vector from a population given a weight vector.
virtual void nextSeeds() override
Compute the next set of seeds to facilitate proposals.
std::vector< Real > _tpm_modified
Modified transition vector considering the seed input.
registerMooseObject("StochasticToolsApp", IndependentMHDecision)
dof_id_type _num_confg_params
Storage for the number of experimental configuration parameters.
virtual void nextSamples(std::vector< Real > &req_inputs, DenseMatrix< Real > &input_matrix, const std::vector< Real > &tv, const unsigned int ¶llel_index) override
Resample inputs given the transition vector (after transition vector computed)
std::vector< Real > & _variance
Model variance term.
std::vector< Real > & _seed_input
Seed vector input for proposing new samples.
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void paramError(const std::string ¶m, Args... args) const
const std::vector< const Distribution * > _priors
Storage for the priors.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
IndependentMHDecision(const InputParameters ¶meters)
dof_id_type _props
Storage for the number of parallel proposals.
std::vector< Real > _outputs_sto
Store the gathered outputs.
static InputParameters validParams()
virtual void computeTransitionVector(std::vector< Real > &tv, const std::vector< Real > &evidence) override
Compute the transition probability vector (after the computation of evidence)
std::vector< const LikelihoodFunctionBase * > _likelihoods
Storage for the likelihood objects to be utilized.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
Sampler & _sampler
The MCMC sampler.
A class for performing independent Metropolis-Hastings MCMC decision making.
const std::vector< Real > & _new_var_samples
Storage for new proposed variance samples.
const std::vector< Real > & _rnd_vec
Storage for the random numbers for decision making.
std::vector< Real > & _outputs_required
Transfer the right outputs to the file.
A class for performing M-H MCMC sampling with independent Gaussian propoposals.
static const std::string k
std::vector< std::vector< Real > > & _inputs
Model input data that is uncertain.
dof_id_type getNumberOfCols() const
static InputParameters validParams()
std::vector< Real > _seed_outputs
Outputs corresponding to the seed input vector.