Loading...
Searching...
No Matches
gpr::bo::SquaredExponential Class Reference

k(r^2) = variance * exp(-r^2 / 2). The value at zero is the variance. More...

#include <gpr/bo/StationaryKernel.h>

Public Member Functions

 SquaredExponential (double variance=1.0)
double operator() (double squared_distance) const
double derivative (double squared_distance) const
 Right-hand derivatives of operator() with respect to its argument.
double secondDerivative (double squared_distance) const
double variance () const noexcept

Detailed Description

k(r^2) = variance * exp(-r^2 / 2). The value at zero is the variance.

Definition at line 119 of file StationaryKernel.h.

Constructor & Destructor Documentation

◆ SquaredExponential()

gpr::bo::SquaredExponential::SquaredExponential ( double variance = 1.0)
inlineexplicit

Definition at line 121 of file StationaryKernel.h.

121 : variance_(variance)
122 {
123 if (!(variance_ > 0.0) || !std::isfinite(variance_)) {
124 throw std::invalid_argument("signal variance must be positive");
125 }
126 }
double variance() const noexcept

Member Function Documentation

◆ derivative()

double gpr::bo::SquaredExponential::derivative ( double squared_distance) const
inlinenodiscard

Right-hand derivatives of operator() with respect to its argument.

Definition at line 134 of file StationaryKernel.h.

135 {
136 return -0.5 * (*this)(squared_distance);
137 }

◆ operator()()

double gpr::bo::SquaredExponential::operator() ( double squared_distance) const
inline

Definition at line 128 of file StationaryKernel.h.

129 {
130 return variance_ * std::exp(-0.5 * squared_distance);
131 }

◆ secondDerivative()

double gpr::bo::SquaredExponential::secondDerivative ( double squared_distance) const
inlinenodiscard

Definition at line 139 of file StationaryKernel.h.

140 {
141 return 0.25 * (*this)(squared_distance);
142 }

◆ variance()

double gpr::bo::SquaredExponential::variance ( ) const
inlinenodiscardnoexcept

Definition at line 144 of file StationaryKernel.h.

145 {
146 return variance_;
147 }

The documentation for this class was generated from the following file: