Extracts the log likelihood, deviance, and AIC of a fitted Poisson point process model, or analogous quantities based on the pseudolikelihood or logistic likelihood for a fitted Gibbs point process model.
# S3 method for ppm
logLik(object, …, new.coef=NULL, warn=TRUE, absolute=FALSE)# S3 method for ppm
deviance(object, …)
# S3 method for ppm
AIC(object, …, k=2, takeuchi=TRUE)
# S3 method for ppm
extractAIC(fit, scale=0, k=2, …, takeuchi=TRUE)
# S3 method for ppm
nobs(object, …)
Fitted point process model.
An object of class "ppm"
.
Ignored.
If TRUE
, a warning is given when the
pseudolikelihood or logistic likelihood
is returned instead of the likelihood.
Logical value indicating whether to include constant terms in the loglikelihood.
Ignored.
Numeric value specifying the weight of the equivalent degrees of freedom in the AIC. See Details.
New values for the canonical parameters of the model.
A numeric vector of the same length as coef(object)
.
Logical value specifying whether to use the Takeuchi penalty
(takeuchi=TRUE
) or the
number of fitted parameters (takeuchi=FALSE
)
in calculating AIC.
logLik
returns a numerical value, belonging to the class
"logLik"
, with an attribute "df"
giving the degrees of
freedom.
AIC
returns a numerical value.
extractAIC
returns a numeric vector of length 2
containing the degrees of freedom and the AIC value.
nobs
returns an integer value.
These functions are methods for the generic commands
logLik
,
deviance
,
extractAIC
and
nobs
for the class "ppm"
.
An object of class "ppm"
represents a fitted
Poisson or Gibbs point process model.
It is obtained from the model-fitting function ppm
.
The method logLik.ppm
computes the
maximised value of the log likelihood for the fitted model object
(as approximated by quadrature using the Berman-Turner approximation)
is extracted. If object
is not a Poisson process, the maximised log
pseudolikelihood is returned, with a warning (if warn=TRUE
).
The Akaike Information Criterion AIC for a fitted model is defined as
$$
AIC = -2 \log(L) + k \times \mbox{penalty}
$$
where \(L\) is the maximised likelihood of the fitted model,
and \(\mbox{penalty}\) is a penalty for model complexity,
usually equal to the effective degrees of freedom of the model.
The method extractAIC.ppm
returns the analogous quantity
\(AIC*\) in which \(L\) is replaced by \(L*\),
the quadrature approximation
to the likelihood (if fit
is a Poisson model)
or the pseudolikelihood or logistic likelihood
(if fit
is a Gibbs model).
The \(\mbox{penalty}\) term is calculated
as follows. If takeuchi=FALSE
then \(\mbox{penalty}\) is
the number of fitted parameters. If takeuchi=TRUE
then
\(\mbox{penalty} = \mbox{trace}(J H^{-1})\)
where \(J\) and \(H\) are the estimated variance and hessian,
respectively, of the composite score.
These two choices are equivalent for a Poisson process.
The method nobs.ppm
returns the number of points
in the original data point pattern to which the model was fitted.
The R function step
uses these methods.
Varin, C. and Vidoni, P. (2005) A note on composite likelihood inference and model selection. Biometrika 92, 519--528.
ppm
,
as.owin
,
coef.ppm
,
fitted.ppm
,
formula.ppm
,
model.frame.ppm
,
model.matrix.ppm
,
plot.ppm
,
predict.ppm
,
residuals.ppm
,
simulate.ppm
,
summary.ppm
,
terms.ppm
,
update.ppm
,
vcov.ppm
.
# NOT RUN {
data(cells)
fit <- ppm(cells, ~x)
nobs(fit)
logLik(fit)
deviance(fit)
extractAIC(fit)
AIC(fit)
step(fit)
# }
Run the code above in your browser using DataLab