Ensures that a fitted spatial logistic regression specifies a well-defined model.
# S3 method for slrm
emend(object, …, fatal=FALSE, trace=FALSE)
Fitted point process model (object of class "slrm"
).
Ignored.
Logical value indicating whether to generate an error if the model cannot be projected to a valid model.
Logical value indicating whether to print a trace of the decision process.
Another point process model (object of class "slrm"
).
emend.slrm
is a method for the generic emend
,
The purpose of the function is to ensure that a fitted model is valid.
The model-fitting function slrm
fits spatial logistic regression models to point pattern data.
In some circumstances, the fitted model returned by slrm
may not
specify a well-defined model, because
some of the fitted coefficients of the model
may be NA
or infinite values.
This usually occurs when the data are insufficient to estimate
all the parameters. The model is said to be
unidentifiable or confounded.
The function emend.slrm
modifies the model object
so that the model is valid. It
identifies the terms in the model object
that are associated with illegal parameter values (i.e. parameter
values which are either NA
, infinite, or outside their permitted
range). It considers all possible sub-models of object
obtained by deleting one or more
of these terms. It identifies which of these submodels are valid,
and chooses the valid submodel with the largest pseudolikelihood. The result
of emend.slrm
or project.slrm
is the
true maximum pseudolikelihood fit to the data.
For large datasets or complex models, the algorithm used in
emend.slrm
may be time-consuming, because it takes time to
compute all the sub-models. A faster, approximate
algorithm can be applied by setting
spatstat.options(project.fast=TRUE)
. This produces a
valid submodel, which may not be the maximum likelihood submodel.
Use the function valid.slrm
to check whether a fitted model
object specifies a well-defined model.
# NOT RUN {
fit <- slrm(redwood ~ x + I(x))
coef(fit)
fit2 <- emend(fit)
coef(fit2)
# }
Run the code above in your browser using DataLab