geolm {gear} | R Documentation |
Linear model for geostatistical data.
Description
geolm
creates a geostatistical linear model object
of the appropriate class based on the arguments,
especially the cmod
arguments.
Usage
geolm(
formula,
data,
coordnames,
mod,
weights = NULL,
mu = NULL,
longlat = NULL,
cmod = NULL
)
Arguments
formula |
An object of class
|
data |
A data frame containing the response, covariates, and location coordinates. |
coordnames |
The columns of |
mod |
A model object produced by one
of the |
weights |
An optional vector of weights for the
errors to be used in the fitting process. A vector
that is proportional to the reciprocal variances of the
errors, i.e., errors are assumed to be uncorrelated
with variances |
mu |
A single numeric value indicating the consant
mean of the spatial process if simple kriging is
desired. Default is |
longlat |
A logical indicating whether Euclidean
( |
cmod |
Retained for backwards compatibility. A model object produced by one
of the |
Details
Note: for the multiresolution Gaussian process model, if
cmod$est == "f"
(i.e., if the nugget is finescale
instead of measurement error), then the weights
argument is internally set to rep(1, n)
, where
n
is the number of observations.
formula
should be specified after the form y
~ x1 + x2
, where y
is the response variable and
x1
and x2
are the covariates of interest.
If mu
is provided, the variables to the right of
~
are ignored.
Value
Returns a geolm_*
object, where *
depends on mod
.
Author(s)
Joshua French
Examples
data = data.frame(y = rnorm(10), x1 = runif(10),
x2 = runif(10))
d = geodist(data[,c("x1", "x2")])
mod = cmod_man(v = exp(-d), evar = 1)
gearmod = geolm(y ~ x1, data = data,
coordnames = ~ x1 + x2, mod = mod)