Skip to contents

VariogramLoglik: log-likelihood of \(\Sigma = psill\,R(range) + nugget\,I\) with the GLS trend (REML adds \((\log|X'X| - \log|X'\Sigma^{-1}X|)/2\), Harville 1974, as geoR). Likfit: \(\beta, \sigma^2\) profiled out, \((\log\phi, \log\tau^2/\sigma^2)\) by Nelder-Mead (Mardia and Marshall 1984; Diggle and Ribeiro 2007). SelectVariogramModel: smallest AIC.

Usage

VariogramLoglik(z, coords, model, nugget = 0, X = NULL, method = "ML")

Likfit(
  z,
  coords,
  model,
  X = NULL,
  method = "ML",
  fix_nugget = FALSE,
  nugget = 0
)

SelectVariogramModel(z, coords, models, X = NULL, method = "ML")

Arguments

z

Values.

coords

Two-column matrix.

model

Component list (psill, range, kappa as used).

nugget

Nugget (fixed value or starting value).

X

Trend design (default intercept).

method

"ML" or "REML".

fix_nugget

Hold the nugget fixed.

models

List of candidate components.

Value

Log-likelihood, or a list of estimates with loglik, npars, AIC, BIC.

References

Mardia, K. V. and Marshall, R. J. (1984). Maximum likelihood estimation of models for residual covariance in spatial regression. Biometrika 71, 135-146.

Diggle, P. J. and Ribeiro, P. J. (2007). Model-based Geostatistics. Springer.

Examples

VariogramLoglik(c(0.5, -0.2, 0.9), rbind(c(0, 0), c(1, 0), c(0, 1)),
                list(model = "Exp", psill = 1, range = 1), nugget = 0.1)
#> [1] -3.137442