Usage
## S3 method for class 'NULL,ANY,ANY,ANY':
lgm(
formula=NULL, data,
grid,
covariates=NULL,
...)
## S3 method for class 'numeric,ANY,ANY,ANY':
lgm(formula, data,
grid,
covariates=NULL,
...)
## S3 method for class 'character,ANY,ANY,ANY':
lgm(formula, data,
grid,
covariates=NULL,
...)
## S3 method for class 'formula,Spatial,ANY,missing':
lgm(formula, data,
grid=NULL,
covariates=NULL,
...)
## S3 method for class 'formula,Raster,ANY,ANY':
lgm(formula, data,
grid,
covariates=NULL,
...)
## S3 method for class 'formula,Raster,ANY,ANY':
lgm(
formula, data,
grid=NULL,
covariates=NULL,
...)
## S3 method for class 'formula,Spatial,numeric,ANY':
lgm(formula, data,
grid,
covariates=NULL,
...)
## S3 method for class 'formula,Spatial,Raster,ANY':
lgm(formula, data,
grid,
covariates=NULL, buffer=0,
...)
## S3 method for class 'formula,Spatial,Raster,data.frame':
lgm(formula, data,
grid,
covariates=NULL,
shape=1, boxcox=1, nugget = 0,
expPred=FALSE, nuggetInPrediction=TRUE,
reml=TRUE,mc.cores=1,
aniso=FALSE,
fixShape=TRUE,
fixBoxcox=TRUE,
fixNugget = FALSE,
...)
## S3 method for class 'formula,data.frame,Raster,data.frame':
lgm(formula, data,
grid,
covariates=NULL,
shape=1,boxcox=1,nugget=0,
expPred=FALSE, nuggetInPrediction=TRUE,
reml = TRUE,
mc.cores=1,
oneminusar=seq(0.01, 0.4,len=4),
range=NULL,
...)
Arguments
formula
A model formula for the fixed effects, or a character string specifying the response variable.
data
A SpatialPointsDataFrame
or Raster
layer, brick or stack containing the locations and observations, and possibly covariates.
grid
Either a raster
, or a single integer giving the
number of cells in the X direction which predictions will be made on. If the later
the predictions will be a raster of square cells covering the boundin covariates
The spatial covariates used in prediction, either a raster
stack or list of rasters.
Covariates in formula
but not in data
will be extracted from covariates
. shape
Order of the Matern correlation
boxcox
Box-Cox transformation parameter (or vector of parameters), set to 1 for no transformation.
nugget
Value for the nugget effect (observation error) variance, or vector of such values.
expPred
Should the predictions be exponentiated, defaults to FALSE
.
nuggetInPrediction
If TRUE
, predict new observations by adding the
nugget effect. The prediction variances will be adjusted accordingly, and the predictions
on the natural scale for logged or Box Cox transformed data will be affected.
Otherwise predict fitt
reml
If TRUE
(the default), use restricted maximum likelihood.
mc.cores
If mc.cores>1
, this argument is passed to mcmapply
and computations are
done in parallel where possible. aniso
Set to TRUE
to use geometric anisotropy.
fixShape
Set to FALSE
to estimate the Matern order
fixBoxcox
Set to FALSE
to estimate the Box-Cox parameter.
fixNugget
Set to FALSE
to estimate the nugget effect parameter.
oneminusar
Vector of GMRF autoregressive parameters over which the likelihood is computed.
range
Vector of range parameters over which the likelihood is computed, ignored if oneminusar
is non-NULL
buffer
Extra distance to add around grid
.
...
Additional arguments passed to likfitLgm
. Starting values can be
specified with a vector param
of named elements