cov_expo_aniso: Anisotropic exponential covariance function

Description Usage Arguments Value Parametrization Examples

View source: R/covariance.R

Description

From a location matrix (locs) and a vector with covariance parameters (covparms), this function returns an anisotropic exponential covariance matrix.

Usage

1
cov_expo_aniso(locs, covparms)

Arguments

locs

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

covparms

A vector with covariance parameters in the form (variance, range, degree of anisotropy)

Value

A matrix with n rows and n columns, with the (i, j) entry containing the anisotropic exponenital covariance between observations locs[i, ] and locs[j, ]

Parametrization

The covariance parameter vector is (variance, range, degree of anisotropy) = (σ^2 , r, α). The form of the covariance is

C(x, y) = σ^2 exp( || A ( x - y ) || / r)

where x and y are locations in R^p and A is a diagonal matrix diag( √ α , 1 , ... , 1 ).

Examples

1
2
3
4
5
# grid locations
cov_expo_aniso(locs = expand.grid(c(0.25, 0.75), c(0.25, 0.75)), covparms = c(1, 0.1, 10))

# randomly selected locations
cov_expo_aniso(locs = matrix(runif(8), 4, 2), covparms = c(1, 0.1, 10))

myeongjong/GPsim documentation built on Dec. 11, 2019, 12:37 p.m.