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

◆ gp_periodic_cov() [1/3]

template<typename T_x , typename T_sigma , typename T_l , typename T_p >
Eigen::Matrix< return_type_t< T_x, T_sigma, T_l, T_p >, Eigen::Dynamic, Eigen::Dynamic > stan::math::gp_periodic_cov ( const std::vector< T_x > &  x,
const T_sigma &  sigma,
const T_l &  l,
const T_p &  p 
)
inline

Returns a periodic covariance matrix \( \mathbf{K} \) using the input \( \mathbf{X} \).

The elements of \( \mathbf{K} \) are defined as \( \mathbf{K}_{ij} = k(\mathbf{X}_i,\mathbf{X}_j), \) where \( \mathbf{X}_i \) is the \(i\)-th row of \( \mathbf{X} \) and
\( k(\mathbf{x},\mathbf{x}^\prime) = \sigma^2 \exp\left(-\frac{2\sin^2(\pi |\mathbf{x}-\mathbf{x}^\prime|/p)}{\ell^2}\right), \)
where \( \sigma^2 \), \( \ell \) and \( p \) are the signal variance, length-scale and period.

Template Parameters
T_xtype of std::vector elements of x. T_x can be a scalar, an Eigen::Vector, or an Eigen::RowVector.
T_sigmatype of sigma
T_ltype of length-scale
T_ptype of period
Parameters
xstd::vector of input elements. This function assumes that all elements of x have the same size.
sigmastandard deviation of the signal
llength-scale
pperiod
Returns
periodic covariance matrix
Exceptions
std::domain_errorif sigma <= 0, l <= 0, p <= 0 or x is nan or infinite

Definition at line 47 of file gp_periodic_cov.hpp.