This is an old version, view current version.

6.13 Covariance functions

6.13.1 Exponentiated quadratic covariance function

The exponentiated quadratic kernel defines the covariance between f(xi) and f(xj) where f:RDR as a function of the squared Euclidian distance between xiRD and xjRD: cov(f(xi),f(xj))=k(xi,xj)=α2exp(12ρ2Dd=1(xi,dxj,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, KRN×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 KRN×M covariance matrix for x1,,xN and x1,,xM, where xiRD and xiRD and Ki,j=k(xi,xj).

matrix cov_exp_quad(row_vectors x, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x.
Available since 2.16

matrix cov_exp_quad(vectors x, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x.
Available since 2.16

matrix cov_exp_quad(array[] real x, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x.
Available since 2.16

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.
Available since 2.18

matrix cov_exp_quad(vectors x1, vectors x2, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x1 and x2.
Available since 2.18

matrix cov_exp_quad(array[] real x1, array[] real x2, real alpha, real rho)
The covariance matrix with an exponentiated quadratic kernel of x1 and x2.
Available since 2.18