Class covar_funct_rbf_noise (o2scl)

O2scl : Class List

class covar_funct_rbf_noise : public o2scl::covar_funct

Covariance function: 1D RBF with a noise term.

Public Functions

inline virtual ~covar_funct_rbf_noise()
inline virtual size_t get_n_params()

Get the number of parameters (always returns 2)

template<class vec_t>
inline void set_params(vec_t &p)

Set the parameters.

inline virtual double operator()(double x1, double x2)

The covariance function.

inline virtual double deriv(double x1, double x2)

The derivative of the covariance function with respect to the first argument.

inline virtual double deriv2(double x1, double x2)

The second derivative of the covariance function with respect to the first argument.

inline virtual double integ(double x, double a, double b)

The integral of the covariance function over \( [a,b] \).

The integral of the function is

\[ \int_a^b f(x) dx = \sum_i A_i \int_a^b C(x,x_i) dx \]
where \( A_i = (K^{-1})_{ij} f_j \). To compute the integral we use
\[ \int_a^b C(x,x_i) dx = \int_{a+x_i}^{b+x_i} \exp \left( - \frac{x^2}{2 L^2} \right) dx = \int_{(a+x_i)/(L\sqrt{2})}^{(b+x_i)/(L\sqrt{2})} L \sqrt{2} \exp \left( - y^2 \right) dy \]
But
\[ \mathrm{erf}(x) \equiv \frac{2}{\sqrt{\pi}} \int_0^{x} e^{-t^2} \]
so
\[ \int_a^b C(x,x_i) dx = L \frac{\sqrt{\pi}}{\sqrt{2}} \left[ \mathrm{erf}\left( \frac{b+x_i}{L \sqrt{2}} \right) - \mathrm{erf}\left( \frac{a+x_i}{L \sqrt{2}} \right) \right] \]

Public Members

double len

Length parameter.

double log10_noise

Noise parameter.