5.13 Covariance functions
5.13.1 Exponentiated quadratic covariance function
The exponentiated quadratic kernel defines the covariance between f(xi) and f(xj) where f:RD↦R as a function of the squared Euclidian distance between xi∈RD and xj∈RD: cov(f(xi),f(xj))=k(xi,xj)=α2exp(−12ρ2D∑d=1(xi,d−xj,d)2) with α and ρ constrained to be positive.
There are two variants of the exponentiated quadratic covariance function in Stan. One builds a covariance matrix, K∈RN×N for x1,…,xN, where Ki,j=k(xi,xj), which is necessarily symmetric and positive semidefinite by construction. There is a second variant of the exponentiated quadratic covariance function that builds a K∈RN×M covariance matrix for x1,…,xN and x′1,…,x′M, where xi∈RD and x′i∈RD and Ki,j=k(xi,x′j).
matrix
cov_exp_quad
(row_vectors x, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x.
matrix
cov_exp_quad
(vectors x, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x.
matrix
cov_exp_quad
(real[] x, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x.
matrix
cov_exp_quad
(row_vectors x1, row_vectors x2, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x1 and
x2.
matrix
cov_exp_quad
(vectors x1, vectors x2, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x1 and
x2.
matrix
cov_exp_quad
(real[] x1, real[] x2, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x1 and
x2.