logLik.mppm: Log Likelihood and AIC for Multiple Point Process Model

View source: R/mppm.R

logLik.mppmR Documentation

Log Likelihood and AIC for Multiple Point Process Model

Description

For a point process model that has been fitted to multiple point patterns, these functions extract the log likelihood and AIC, or analogous quantities based on the pseudolikelihood.

Usage

 ## S3 method for class 'mppm'
logLik(object, ..., warn=TRUE)

 ## S3 method for class 'mppm'
AIC(object, ..., k=2, takeuchi=TRUE)

 ## S3 method for class 'mppm'
extractAIC(fit, scale = 0, k = 2, ..., takeuchi = TRUE) 

 ## S3 method for class 'mppm'
nobs(object, ...)

 ## S3 method for class 'mppm'
getCall(x, ...)

 ## S3 method for class 'mppm'
terms(x, ...)

Arguments

object,fit,x

Fitted point process model (fitted to multiple point patterns). An object of class "mppm".

...

Ignored.

warn

If TRUE, a warning is given when the pseudolikelihood is returned instead of the likelihood.

scale

Ignored.

k

Numeric value specifying the weight of the equivalent degrees of freedom in the AIC. See Details.

takeuchi

Logical value specifying whether to use the Takeuchi penalty (takeuchi=TRUE) or the number of fitted parameters (takeuchi=FALSE) in calculating AIC.

Details

These functions are methods for the generic commands logLik, AIC, extractAIC, terms and getCall for the class "mppm".

An object of class "mppm" represents a fitted Poisson or Gibbs point process model fitted to several point patterns. It is obtained from the model-fitting function mppm.

The method logLik.mppm extracts the maximised value of the log likelihood for the fitted model (as approximated by quadrature using the Berman-Turner approximation). If object is not a Poisson process, the maximised log pseudolikelihood is returned, with a warning.

The Akaike Information Criterion AIC for a fitted model is defined as

AIC = -2 * log(L) + k * penalty

where L is the maximised likelihood of the fitted model, and penalty is a penalty for model complexity, usually equal to the effective degrees of freedom of the model. The method extractAIC.mppm 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 (if fit is a Gibbs model).

The penalty term is calculated as follows. If takeuchi=FALSE then penalty is the number of fitted parameters. If takeuchi=TRUE then penalty = 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.mppm returns the total number of points in the original data point patterns to which the model was fitted.

The method getCall.mppm extracts the original call to mppm which caused the model to be fitted.

The method terms.mppm extracts the covariate terms in the model formula as a terms object. Note that these terms do not include the interaction component of the model.

The R function step uses these methods.

Value

See the help files for the corresponding generic functions.

Author(s)

Adrian Baddeley, Ida-Maria Sintorn and Leanne Bischoff. Implemented by \spatstatAuthors.

References

Baddeley, A., Rubak, E. and Turner, R. (2015) Spatial Point Patterns: Methodology and Applications with R. London: Chapman and Hall/CRC Press.

See Also

mppm

Examples

  fit <- mppm(Bugs ~ x, hyperframe(Bugs=waterstriders))
  logLik(fit)
  AIC(fit)
  nobs(fit)
  getCall(fit)

spatstat.core documentation built on May 18, 2022, 9:05 a.m.