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_x | type of elements in the std::vector |
- Parameters
-
x | std::vector of input elements. Assumes that all elements of x have the same size. |
sigma | standard deviation of the signal |
l | length-scale |
p | period |
- Returns
- periodic covariance matrix
- Exceptions
-
std::domain_error | if sigma <= 0, l <= 0, p <= 0, or x is nan or infinite |
Definition at line 42 of file gp_periodic_cov.hpp.