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

◆ gp_matern32_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_matern32_cov ( const std::vector< Eigen::Matrix< T_x1, -1, 1 > > &  x1,
const std::vector< Eigen::Matrix< T_x2, -1, 1 > > &  x2,
const T_s &  sigma,
const std::vector< T_l > &  length_scale 
)
inline

Returns a Matern 3/2 cross covariance matrix.

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

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

This function is for the cross covariance matrix needed to compute the posterior predictive density.

Template Parameters
T_x1first type of std::vector of scalars
T_x2second type of std::vector of scalars
T_stype of parameter sigma, marginal standard deviation
T_ltype of parameter length scale
Parameters
x1std::vector of Eigen vectors of scalars
x2std::vector of Eigen vectors of scalars
length_scaleparameter length scale
sigmastandard deviation that can be used in stan::math::square
Exceptions
std::domainerror if sigma <= 0, l <= 0, or x1, x2 are nan or inf

Definition at line 268 of file gp_matern32_cov.hpp.