Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ gp_matern52_cov() [3/6]

template<typename T_x , typename T_s , typename T_l >
Eigen::Matrix< return_type_t< T_x, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > stan::math::gp_matern52_cov ( const std::vector< T_x > &  x,
const T_s &  sigma,
const T_l &  length_scale 
)
inline

Returns a Matern 5/2 covariance matrix with one input vector.

\[ k(x, x') = \sigma^2\bigg(1 + \frac{\sqrt{5}d(x, x')}{l} + \frac{5d(x, x')^2}{3l^2}\bigg) exp\bigg(-\frac{5 d(x, x')}{l}\bigg) \]

where \( d(x, x') \) is the Euclidean distance.

Template Parameters
T_xtype of elements contained in vector x
T_stype of element of sigma, the magnitude
T_ltype of elements of length scale
Parameters
xstd::vector of elements that can be used in stan::math::distance
length_scalelength scale
sigmastandard deviation that can be used in stan::math::square
Exceptions
std::domainerror if sigma <= 0, l <= 0, or x is nan or inf

Definition at line 41 of file gp_matern52_cov.hpp.