R/exponential.R

Defines functions exponential

# ============================================================================
# Wrapper to the covmat functions
#
# Details:
# Calculates the Exponential covariance matrix
#
# Inputs:
# - dmatrix a distance matrix, having real non-negative
# - nugget a non-negative value
# - sill a non-negative value
# - range a non-negative value
#
# Outputs:
# - A matrix with same size as dmatrix
# ============================================================================
exponential <- function(dmatrix, nugget, sill, range) {
  # Calculate the exponential covariance
  cov <- sill * exp(-3 * dmatrix / range)
  #diag(cov) <- diag(cov) + nugget

  return(cov)
}

Try the BMEmapping package in your browser

Any scripts or data that you put into this service are public.

BMEmapping documentation built on July 2, 2025, 9:07 a.m.