Class covar_funct_rbf (o2scl)¶
-
class covar_funct_rbf : public o2scl::covar_funct¶
Covariance function: one-dimensional radial basis function.
Public Functions
-
inline covar_funct_rbf()¶
-
inline virtual ~covar_funct_rbf()¶
-
inline virtual size_t get_n_params()¶
Get the number of parameters (always returns 1)
-
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] \]
-
inline covar_funct_rbf()¶