Description Usage Arguments Details Author(s) See Also Examples
This page documents the methods deviance
,
logLik
, extractAIC
, add1
, drop1
,
step
and waldtest
for the class georob
. The package
georob
provides a generic step
function and a default
method which is identical with the (non-generic) function step
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ## S3 method for class 'georob'
deviance(object, warn = TRUE, ...)
## S3 method for class 'georob'
logLik(object, REML = FALSE, ...)
## S3 method for class 'georob'
extractAIC(fit, scale = 0, k = 2, ...)
## S3 method for class 'georob'
add1(object, scope, scale = 0, test = c("none", "Chisq"), k = 2,
trace = FALSE, data = NULL, fixed = TRUE, use.fitted.param = TRUE, verbose = 0,
ncores = 1, ...)
## S3 method for class 'georob'
drop1(object, scope, scale = 0, test = c("none", "Chisq"), k = 2,
trace = FALSE, data = NULL, fixed = TRUE, use.fitted.param = TRUE, verbose = 0,
ncores = 1, ...)
step(object, ...)
## Default S3 method:
step(object, scope, scale = 0,
direction = c("both", "backward", "forward"), trace = 1,
keep = NULL, steps = 1000, k = 2, ...)
## S3 method for class 'georob'
step(object, scope, scale = 0,
direction = c("both", "backward", "forward"), trace = 1,
keep = NULL, steps = 1000, k = 2, data = NULL, fixed = TRUE,
use.fitted.param = TRUE, verbose = 0, ncores = 1, ...)
## S3 method for class 'georob'
waldtest(object, ..., vcov = NULL, test = c("Chisq", "F"),
name = NULL, fixed = TRUE)
|
object, fit |
an object of class |
data |
an optional data frame. |
direction |
the mode of stepwise search, see
|
fixed |
logical controlling whether the variogram parameters are
not adjusted when fitting alternative regression models for Wald
test and for |
k |
numeric specifying the 'weight' of the equivalent degrees of
freedom (=: edf) part in the AIC formula, see
|
keep |
a filter function whose input is a fitted model object and the
associated |
name |
a function for extracting a suitable name/description from a
fitted model object. By default the name is queried by calling
|
ncores |
integer specifying the number of cores used for
parallelized execution of |
REML |
logical controlling whether the restricted loglikelihood
should be extracted (default |
scale |
numeric, currently not used, see
|
scope |
defines the range of models examined in the stepwise search.
This should be either a single formula, or a list containing
components |
steps |
the maximum number of steps to be considered
(default is 1000), see |
test |
character keyword specifying whether to compute the large
sample Chi-squared statistic (with asymptotic Chi-squared distribution)
or the finite sample F statistic (with approximate F distribution), see
|
trace |
if positive, information is printed during the running of
|
use.fitted.param |
logical scalar controlling whether fitted
values of |
vcov |
a function for estimating the covariance matrix of the
regression coefficients, see |
verbose |
positive integer controlling logging of diagnostic
messages to the console during model fitting, see |
warn |
logical scalar controlling whether warnings should be suppressed. |
... |
additional arguments passed to methods (see in particular
|
For a non-robust fit the function deviance
returns the residual deviance
(Y - X hatβ)^T(τ^2 I + Γ_hatθ)^{-1}(Y - X hatβ)
(see georob-package
for an explanation of the notation).
For a robust fit the deviance is not defined. The function then computes with a warning
the deviance of an equivalent Gaussian model with heteroscedastic nugget
τ/w where w are
the “robustness weights” rweights
, see georobObject
.
logLik
returns the the maximized (restricted) loglikelihood. For
a robust fit, the loglikelihood is not defined. The function then
returns NA
if REML==TRUE
or computes the likelihood of an
equivalent Gaussian model with heteroscedastic nugget (see above).
The methods extractAIC
, add1
, drop1
and step
are used for stepwise model building. If fixed==TRUE
(default)
then the variogram parameters are kept fixed at the values fitted for
fixed-effects model in object
. For fixed==FALSE
the
variogram parameters are fitted for each model tested by add1
and
drop1
. Then either the variogram parameters in
object$initial.objects
(use.fitted.param==FALSE
or the
fitted parameters of object
(use.fitted.param==TRUE) are used
as initial values.
In addition, the functions of the R package multcomp can be used to test general linear hypotheses about the fixed effects of the model.
Andreas Papritz andreas.papritz@env.ethz.ch
georobIntro
for a description of the model and a brief summary of the algorithms;
georob
for (robust) fitting of spatial linear models;
georobObject
for a description of the class georob
;
georobMethods
for further methods for the class georob
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ## Not run:
data(meuse)
## Gaussian REML fit
r.logzn.reml <- georob(log(zinc) ~ sqrt(dist), data = meuse, locations = ~ x + y,
variogram.model = "exponential",
param = c( variance = 0.15, nugget = 0.05, scale = 200 ),
tuning.psi = 1000,
control = georob.control(cov.bhat = TRUE, cov.ehat.p.bhat = TRUE))
summary(r.logzn.reml, correlation = TRUE)
deviance(r.logzn.reml)
logLik(r.logzn.reml)
waldtest(r.logzn.reml, .~. + ffreq)
waldtest(r.logzn.reml, .~. + ffreq, fixed = FALSE)
step(r.logzn.reml, ~ sqrt(dist) + ffreq + soil)
## robust REML fit
r.logzn.rob <- update(r.logzn.reml, tuning.psi = 1)
deviance(r.logzn.rob)
logLik(r.logzn.rob)
logLik(r.logzn.rob, REML=TRUE)
step(r.logzn.rob, ~ sqrt(dist) + ffreq + soil, fixed=FALSE, trace=2)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.