folded.matern.covariance.1d: The 1d folded Matern covariance function

View source: R/util.R

folded.matern.covariance.1dR Documentation

The 1d folded Matern covariance function

Description

folded.matern.covariance.1d evaluates the 1d folded Matern covariance function over an interval [0,L].

Usage

folded.matern.covariance.1d(
  h,
  m,
  kappa,
  nu,
  sigma,
  L = 1,
  N = 10,
  boundary = c("neumann", "dirichlet", "periodic")
)

Arguments

h, m

Vectors of arguments of the covariance function.

kappa

Range parameter.

nu

Shape parameter.

sigma

Standard deviation.

L

The upper bound of the interval [0,L]. By default, L=1.

N

The truncation parameter.

boundary

The boundary condition. The possible conditions are "neumann" (default), "dirichlet" or "periodic".

Details

folded.matern.covariance.1d evaluates the 1d folded Matern covariance function over an interval [0,L] under different boundary conditions. For periodic boundary conditions

C_{\mathcal{P}}(h,m) = ∑_{k=-∞}^{∞} (C(h-m+2kL),

for Neumann boundary conditions

C_{\mathcal{N}}(h,m) = ∑_{k=-∞}^{∞} (C(h-m+2kL)+C(h+m+2kL)),

and for Dirichlet boundary conditions:

C_{\mathcal{D}}(h,m) = ∑_{k=-∞}^{∞} (C(h-m+2kL)-C(h+m+2kL)),

where C(\cdot) is the Matern covariance function:

C(h) = \frac{σ^2}{2^{ν-1}Γ(ν)}(κ h)^ν K_ν(κ h).

We consider the truncation:

C_{{\mathcal{P}},N}(h,m) = ∑_{k=-N}^{N} C(h-m+2kL), C_{\mathcal{N},N}(h,m) = ∑_{k=-∞}^{∞} (C(h-m+2kL)+C(h+m+2kL)),

and

C_{\mathcal{D},N}(h,m) = ∑_{k=-N}^{N} (C(h-m+2kL)-C(h+m+2kL)).

Value

A matrix with the corresponding covariance values.

Examples

x <- seq(from = 0, to = 1, length.out = 101)
plot(x, folded.matern.covariance.1d(rep(0.5, length(x)), x,
kappa = 10, nu = 1 / 5, sigma = 1),
  type = "l", ylab = "C(h)", xlab = "h"
)


rSPDE documentation built on Sept. 17, 2022, 1:05 a.m.