Loading...
Searching...
No Matches
LikGaussian.inl
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2// Copyright (c) gpridge developers
3// See LICENSE for details.
4
5//
6// LikGaussian.inl
7// gpr_dimer
8//
9// Created by Maxim Masterov on 21/01/2021.
10//
11
12#ifndef LikGaussian_h
13#define LikGaussian_h
14
16
17namespace gpr {
18
19inline void LikGaussian::setSigma2(const double value)
20{
21 sigma2 = value;
22}
23
25{
26 prior_parameters_gaussian.setParameters(prior);
27}
28
30{
31 prior_parameters_sqrtt.setParameters(prior);
32}
33
34inline void LikGaussian::setParameters(const Eigen::VectorXd& /*w*/)
35{
36 // No-op even when sigma2 is in the optimization set: the GP layer
37 // owns the trailing-noise unpack (setParameters routes exp(w_last)
38 // through trainingToPhysicalNoiseVariance before calling setSigma2),
39 // matching the MATLAB lik_gaussian_unpak split of pak/unpak duties.
40}
41
50inline Eigen::VectorXd LikGaussian::combineParameters()
51{
52 Eigen::VectorXd res;
53 if (optimize_sigma2_ && std::isfinite(sigma2) && sigma2 > 0.0) {
54 res.resize(1);
55 res(0) = numerics::log(sigma2);
56 }
57 return res;
58}
59
60} /* namespace gpr */
61
62#endif /* LikGaussian_h */
Eigen::VectorXd combineParameters()
Combine parameters of the gaussian likelihood into one Eigen vector.
void setPriorParametersSqrtt(const PriorBase &prior)
void setParameters(const Eigen::VectorXd &w)
void setPriorParametersGaussian(const PriorBase &prior)
void setSigma2(const double value)
Set sigma2 value.
Class of prior parameters.
Definition PriorBase.h:23
double log(double x) noexcept
Gaussian-process regression, kernels, priors, and the searches that run on the surrogate.
Definition Macros.h:16