20 params.
addClassDescription(
"Covariance function for multioutput Gaussian Processes based on the " 21 "Linear Model of Coregionalization (LMC).");
23 "num_latent_funcs", 1.,
"The number of latent functions for the expansion of the outputs.");
31 _num_expansion_terms(getParam<unsigned
int>(
"num_latent_funcs"))
36 generator_latent.
seed(0, 1980);
41 const std::string a_coeff_name =
"acoeff_" + std::to_string(exp_i);
42 const std::string a_coeff_name_with_prefix =
_name +
":" + a_coeff_name;
48 acoeff_vector[out_i] = 3.0 * generator_latent.
rand(0) + 1.0;
54 const std::string lambda_name =
"lambda_" + std::to_string(exp_i);
55 const std::string lambda_name_with_prefix =
_name +
":" + lambda_name;
61 lambda_vector[out_i] = 3.0 * generator_latent.
rand(0) + 1.0;
69 const bool is_self_covariance)
const 91 const std::string & hyper_param_name,
92 unsigned int ind)
const 96 if (
name().length() + 1 > hyper_param_name.length())
100 const std::string name_without_prefix = hyper_param_name.substr(
name().length() + 1);
105 const std::string acoeff_prefix =
"acoeff_";
106 const std::string lambda_prefix =
"lambda_";
112 if (name_without_prefix.find(acoeff_prefix) != std::string::npos)
115 const int number = std::stoi(name_without_prefix.substr(acoeff_prefix.length()));
119 else if (name_without_prefix.find(lambda_prefix) != std::string::npos)
122 const int number = std::stoi(name_without_prefix.substr(lambda_prefix.length()));
140 found = dependent_covar->computedKdhyper(dKdhp_sub,
x, hyper_param_name, ind);
143 mooseError(
"Hyperparameter ", hyper_param_name,
"not found!");
163 const auto & a_coeffs = *
_a_coeffs[exp_i];
164 const auto & lambda_coeffs = *
_lambdas[exp_i];
169 Bmat(row_i, col_i) = a_coeffs[row_i] * a_coeffs[col_i];
171 Bmat(row_i, col_i) += lambda_coeffs[col_i];
177 const unsigned int exp_i,
178 const unsigned int index)
const 180 const auto & a_coeffs = *
_a_coeffs[exp_i];
184 grad(index, col_i) = a_coeffs[col_i];
192 const unsigned int index)
const 195 grad(index, index) = 1.0;
void computeBMatrix(RealEigenMatrix &Bmat, const unsigned int exp_i) const
Computes the covariance matrix for the outputs (using the latent coefficients) We use a $B = a_i a_i...
std::unordered_set< std::string > _tunable_hp
list of tunable hyper-parameters
void computeAGradient(RealEigenMatrix &grad, const unsigned int exp_i, const unsigned int index) const
Computes the gradient of $B$ with respect to the entries in $a_i$ in the following expression: $B = ...
const unsigned int _num_expansion_terms
The number of expansion terms in the output ovariance matrix.
void kron(RealEigenMatrix &product, const RealEigenMatrix &mat_A, const RealEigenMatrix &mat_B)
static const std::string K
void seed(std::size_t i, unsigned int seed)
bool computedKdhyper(RealEigenMatrix &dKdhp, const RealEigenMatrix &x, const std::string &hyper_param_name, unsigned int ind) const override
Redirect dK/dhp for hyperparameter "hp".
LMC(const InputParameters ¶meters)
std::vector< CovarianceFunctionBase * > _covariance_functions
Vector of pointers to the dependent covariance functions.
Base class for covariance functions that are used in Gaussian Processes.
registerMooseObject("StochasticToolsApp", LMC)
static InputParameters validParams()
const std::vector< Real > & addVectorRealHyperParameter(const std::string &name, const std::vector< Real > value, const bool is_tunable)
Register a vector hyperparameter to this covariance function.
virtual const std::string & name() const
std::vector< const std::vector< Real > * > _a_coeffs
The vectors in the $B = a_i a_i^T + diag(lambda_i)$ expansion.
static InputParameters validParams()
const unsigned int _num_outputs
The number of outputs this covariance function is used to describe.
std::vector< const std::vector< Real > * > _lambdas
const std::vector< double > x
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
std::string grad(const std::string &var)
void computeCovarianceMatrix(RealEigenMatrix &K, const RealEigenMatrix &x, const RealEigenMatrix &xp, const bool is_self_covariance) const override
Generates the Covariance Matrix given two sets of points in the parameter space.
IntRange< T > make_range(T beg, T end)
std::unordered_map< std::string, std::vector< Real > > _hp_map_vector_real
Map of vector-valued hyperparameters.
void mooseError(Args &&... args) const
void computeLambdaGradient(RealEigenMatrix &grad, const unsigned int exp_i, const unsigned int index) const
Computes the gradient of $B$ with respect to the entries in $lambda_i$ in the following expression: $...
Covariance function for multi-output Gaussian Processes based on the linear model of coregionalizatio...
void ErrorVector unsigned int