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

◆ gp_matern52_cov() [6/6]

template<typename T_x1 , typename T_x2 , typename T_s , typename T_l >
Eigen::Matrix< return_type_t< T_x1, T_x2, T_s, T_l >, Eigen::Dynamic, Eigen::Dynamic > stan::math::gp_matern52_cov ( const std::vector< Eigen::Matrix< T_x1, Eigen::Dynamic, 1 > > &  x1,
const std::vector< Eigen::Matrix< T_x2, Eigen::Dynamic, 1 > > &  x2,
const T_s &  sigma,
const std::vector< T_l > &  length_scale 
)
inline

Returns a Matern 5/2 covariance matrix with two input vectors with automatic relevance determination (ARD).

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

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

Template Parameters
T_x1type of elements contained in vector x1
T_x2type of elements contained in vector x2
T_stype of element of sigma, the magnitude
T_ltype of elements in vector of length scale
Parameters
x1std::vector of elements that can be used in stan::math::distance
x2std::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
std::invalid_argumentif length scale size != dimension of x1 or x2

Definition at line 270 of file gp_matern52_cov.hpp.