Learn R Programming

nimblewomble (version 0.1.0)

gaussian: Squared Exponential Covariance kernel

Description

Computes the Matern covariance matrix with fractal parameter \(\nu \to \infty\).

Usage

gaussian(dists, phi, sigma2, tau2)

Value

A matrix of covariance terms. For internal use only.

Arguments

dists

distance matrix

phi

spatial range

sigma2

spatial variance

tau2

nugget variance

Author

Aritra Halder <aritra.halder@drexel.edu>,
Sudipto Banerjee <sudipto@ucla.edu>

Details

Has the option to compute \(\Sigma_{d\times d} + \tau^2 I_d\).

Examples

Run this code
# \donttest{
#####################
# Internal use only #
#####################
# Used across multiple functions
# Example usage
require(nimble)
require(nimblewomble)

set.seed(1)
# Generated Simulated Data
N = 1e2
tau = 1
coords = matrix(runif(2 * N, -10, 10), ncol = 2)
colnames(coords) = c("x", "y")
dists = as.matrix(dist(coords))

cGaussian  = compileNimble(gaussian)
cGaussian(dists = dists[1:N, 1:N], phi = 1, sigma2 = 1, tau2 = 0)
# }

Run the code above in your browser using DataLab