Skip to contents

Calculate exponential correlation

Usage

cor_exp(x, c, gamma = 1/2, nugget = 0, is.dist = FALSE)

Arguments

x

A numeric vector, matrix, or array.

c

Smooth parameter, \(c>0\).

gamma

Scale parameter, \(\gamma\in(0, 1/2]\). Default is 1/2.

nugget

The nugget effect \(\in[0, 1]\).

is.dist

Logical; if TRUE, x is a distance matrix or an array of distance matrices.

Value

Correlations of the same dimension as x.

Details

The exponential correlation function with scale parameter \(c\) and smooth parameter \(\gamma\) has the form $$C(x)=(1-\text{nugget})\exp(-c|x|^{2\gamma})+\text{nugget}\cdot \delta_{x=0},$$ where \(\delta_{x=0}\) is 1 when \(x=0\) and 0 otherwise.

References

Diggle, P. J., Tawn, J. A., & Moyeed, R. A. (1998). Model-Based Geostatistics. Journal of the Royal Statistical Society. Series C (Applied Statistics), 47(3), 299–350.

See also

Other correlation functions: cor_cauchy(), cor_fs(), cor_lagr_askey(), cor_lagr_exp(), cor_lagr_tri(), cor_sep(), cor_stat(), cor_stat_rs()

Examples

x <- matrix(c(0, 5, 5, 0), nrow = 2)
cor_exp(x, c = 0.01, gamma = 0.5)
#>           [,1]      [,2]
#> [1,] 1.0000000 0.9512294
#> [2,] 0.9512294 1.0000000

x <- matrix(c(0, 5, 5, 0), nrow = 2)
cor_exp(x, c = 0.01, gamma = 0.5, nugget = 0.3, is.dist = TRUE)
#>           [,1]      [,2]
#> [1,] 1.0000000 0.6658606
#> [2,] 0.6658606 1.0000000