gmGeostats (version 0.11.3)

fit_lmc: 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 gstatVariogram fit_lmc( v, g, model, fit.ranges = FALSE, fit.lmc = !fit.ranges, correct.diagonal = 1, ... )

# S3 method for default fit_lmc(v, g, model, ...)

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

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

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)

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

Methods (by class)

  • gstatVariogram: wrapper around gstat::fit.lmc method

  • default: flexible wrapper method for any class for which methods for as.gstatVariogram(), as.gstat() and as.variogramModel() exist. In the future there may be direct specialised implementations not depending on package gstat.

  • logratioVariogram: method for logratioVariogram wrapping compositions::fit.lmc. In the future there may be direct specialised implementations, including anisotropy (not yet possible).

  • logratioVariogramAnisotropy: method for logratioVariogram with anisotropry

Examples

Run this code
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)

Run the code above in your browser using DataLab