Go to the documentation of this file. 1 #ifndef HOPS_COLDNESS_HPP
2 #define HOPS_COLDNESS_HPP
16 template<
typename ModelType>
19 explicit Coldness(ModelType model,
double coldness = 1) :
20 ModelType(std::move(model)) {
25 return coldness == 0 ? 0. : coldness * ModelType::computeNegativeLogLikelihood(state);
30 auto gradient = ModelType::computeLogLikelihoodGradient(state);
32 return coldness * gradient.value();
40 auto fisherInformation = ModelType::computeExpectedFisherInformation(state);
41 if (fisherInformation) {
44 return coldness * coldness * fisherInformation.value();
55 if (newColdness > 1) {
57 }
else if (newColdness < 0) {
60 coldness = newColdness;
69 #endif //HOPS_COLDNESS_HPP
MatrixType::Scalar computeNegativeLogLikelihood(const VectorType &state)
Definition: Coldness.hpp:24
std::optional< MatrixType > computeExpectedFisherInformation(const VectorType &state)
Definition: Coldness.hpp:38
Coldness(ModelType model, double coldness=1)
Definition: Coldness.hpp:19
double getColdness() const
Definition: Coldness.hpp:50
std::optional< VectorType > computeLogLikelihoodGradient(const VectorType &state)
Definition: Coldness.hpp:28
Definition: CsvReader.hpp:8
void setColdness(double newColdness)
Definition: Coldness.hpp:54
Eigen::VectorXd VectorType
Definition: VectorType.hpp:7
Mixin that adds coldness to model evaluations.
Definition: Coldness.hpp:17