Learn R Programming

GpGp (version 0.5.1)

matern_categorical: Isotropic Matern covariance function with random effects for categories

Description

From a matrix of locations and covariance parameters of the form (variance, range, smoothness, category variance, nugget), return the square matrix of all pairwise covariances.

Usage

matern_categorical(covparms, locs)

d_matern_categorical(covparms, locs)

Value

A matrix with n rows and n columns, with the i,j entry containing the covariance between observations at locs[i,] and locs[j,].

Arguments

covparms

A vector with covariance parameters in the form (variance, range, smoothness, category variance, nugget)

locs

A matrix with n rows and d columns. Each row of locs gives a point in R^d.

Functions

  • d_matern_categorical(): Derivatives of isotropic Matern covariance

Parameterization

The covariance parameter vector is (variance, range, smoothness, category variance, nugget) = \((\sigma^2,\alpha,\nu,c^2,\tau^2)\), and the covariance function is parameterized as $$ M(x,y) = \sigma^2 2^{1-\nu}/\Gamma(\nu) (|| x - y ||/\alpha )^\nu K_\nu(|| x - y ||/\alpha ) $$ The nugget value \( \sigma^2 \tau^2 \) is added to the diagonal of the covariance matrix. The category variance \(c^2\) is added if two observation from same category NOTE: the nugget is \( \sigma^2 \tau^2 \), not \( \tau^2 \).