Learn R Programming

gear (version 0.1.5)

update.geolmStd: Update linear model for geostatistical data.

Description

update updates a geostatistical linear model based on the given covariance model.

Usage

# S3 method for geolmStd
update(object, cmod, ...)

# S3 method for geolmMan update(object, cmod, ...)

Arguments

object

An object produced by the geolm function.

cmod

A covariance model object obtained from one of the cmod.* functions or the mle function.

...

Not implemented.

Value

Returns an object of the same class as object.

Examples

Run this code
# NOT RUN {
# generate response
y = rnorm(10)
# generate coordinates
x1 = runif(10); x2 = runif(10)

# data frame for observed data
data = data.frame(y, x1, x2)
coords = cbind(x1, x2)
psill = 2 # partial sill
r = 4 # range parameter
evar = .1 # error variance
fvar = .1 # add finescale variance
# one can't generally distinguish between evar and fvar, but
# this is done for illustration purposes

cmod_std = cmod.std("exponential", psill = psill, r = r, 
                    evar = evar, fvar = fvar)

cmod_std2 = cmod.std("exponential", psill = psill + 1, r = r + .5, 
                     evar = evar + .01, fvar = fvar)

# check geolm update for universal kriging
gear1 = geolm(y ~ x1 + x2, data = data,
              coordnames = c("x1", "x2"),
              cmod = cmod_std)
gear2 = geolm(y ~ x1 + x2, data = data,
              coordnames = c("x1", "x2"),
              cmod = cmod_std2)
gear2b = update(gear1, cmod_std2)
identical(gear2, gear2b)
# }

Run the code above in your browser using DataLab