21 "Gaussian likelihood function evaluating the model goodness against experiments.");
22 params.
addParam<
bool>(
"log_likelihood",
true,
"Compute log-likelihood or likelihood.");
24 "noise",
"Experimental noise plus model deviations against experiments.");
25 params.
addParam<FileName>(
"file_name",
"Name of the CSV file with experimental values.");
27 "file_column_name",
"Name of column in CSV file to use, by default first column is used.");
29 "exp_values",
"User-specified experimental values when CSV file is not provided.");
36 _log_likelihood(getParam<bool>(
"log_likelihood")),
37 _noise(getReporterValue<
Real>(
"noise"))
40 paramError(
"exp_values",
"exp_values and file_name both cannot be set at the same time.");
51 _exp_values = getParam<std::vector<Real>>(
"exp_values");
53 mooseError(
"Either 'exp_values' or 'file_name' parameters must be specified to represent " 54 "experimental data.");
59 const std::vector<Real> &
model,
61 const bool & log_likelihood)
65 for (
unsigned i = 0; i <
exp.size(); ++i)
68 val1 = std::log(val1);
72 result = std::exp(result);
All Likelihoods should inherit from this class.
virtual Real function(const std::vector< Real > &x) const override
Return the probability density or mass function at vector x.
Gaussian(const InputParameters ¶meters)
const Real & _noise
Noise value.
A class used to generate a Gaussian likelihood of observing model predictions.
virtual Real pdf(const Real &x) const override
bool isParamValid(const std::string &name) const
const std::vector< double > x
static InputParameters validParams()
const bool _log_likelihood
return log-likelihood or likelihood
std::vector< Real > _exp_values
Experimental data values.
void paramError(const std::string ¶m, Args... args) const
const std::vector< std::vector< T > > & getData() const
const PertinentGeochemicalSystem model(database, {"H2O", "H+", "HCO3-", "O2(aq)", "Ca++", ">(s)FeOH", "radius_neg1", "radius_neg1.5"}, {"Calcite"}, {}, {"Calcite_asdf"}, {"CH4(aq)"}, {">(s)FeOCa+"}, "O2(aq)", "e-")
registerMooseObject("StochasticToolsApp", Gaussian)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
void mooseError(Args &&... args) const