fit_lmc {gmGeostats}R Documentation

Fit an LMC to an empirical variogram

Description

Fit a linear model of coregionalisation to an empirical variogram

Usage

fit_lmc(v, ...)

## S3 method for class 'gstatVariogram'
fit_lmc(
  v,
  g,
  model,
  fit.ranges = FALSE,
  fit.lmc = !fit.ranges,
  correct.diagonal = 1,
  ...
)

## Default S3 method:
fit_lmc(v, g, model, ...)

## S3 method for class 'logratioVariogram'
fit_lmc(v, g, model, ...)

## S3 method for class 'logratioVariogramAnisotropy'
fit_lmc(v, g, model, ...)

Arguments

v

empirical variogram

...

further parameters

g

spatial data object, containing the original data

model

LMC or variogram model to fit

fit.ranges

logical, should ranges be modified? (default=FALSE)

fit.lmc

logical, should the nugget and partial sill matrices be modified (default=TRUE)

correct.diagonal

positive value slightly larger than 1, for multiplying the direct variogram models and reduce the risk of numerically negative eigenvalues

Value

Method fit_lmc.gstatVariogram is a wrapper around gstat::fit.lmc(), that calls this function and gives the resulting model its appropriate class (c("variogramModelList", "list")). Method fit_lmc.default returns the fitted lmc (this function currently uses gstat as a calculation machine, but this behavior can change in the future)

Methods (by class)

Examples

data("jura", package = "gstat")
X = jura.pred[,1:2]
Zc = jura.pred[,7:13]
gg = make.gmCompositionalGaussianSpatialModel(Zc, X, V="alr", formula = ~1)
vg = variogram(gg)
md = gstat::vgm(model="Sph", psill=1, nugget=1, range=1.5)
gg = fit_lmc(v=vg, g=gg, model=md)
variogramModelPlot(vg, model=gg)

[Package gmGeostats version 0.11.3 Index]