Stan Math Library
4.9.0
Automatic Differentiation
|
|
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.
T_x1 | type of elements contained in vector x1 |
T_x2 | type of elements contained in vector x2 |
T_s | type of element of sigma, the magnitude |
T_l | type of elements in vector of length scale |
x1 | std::vector of elements that can be used in stan::math::distance |
x2 | std::vector of elements that can be used in stan::math::distance |
length_scale | length scale |
sigma | standard deviation that can be used in stan::math::square |
std::domain | error if sigma <= 0, l <= 0, or x is nan or inf |
std::invalid_argument | if length scale size != dimension of x1 or x2 |
Definition at line 270 of file gp_matern52_cov.hpp.