# logLik.mppm

##### Log Likelihood and AIC for Multiple Point Process Model

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 mppm
logLik(object, …, warn=TRUE)
``` # S3 method for mppm
AIC(object, …, k=2, takeuchi=TRUE)

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

# S3 method for mppm
nobs(object, …)

# S3 method for mppm
getCall(x, …)

# S3 method for 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 \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.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 \(\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.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.

##### 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

##### Examples

```
# NOT RUN {
fit <- mppm(Bugs ~ x, hyperframe(Bugs=waterstriders))
logLik(fit)
AIC(fit)
nobs(fit)
getCall(fit)
# }
```

*Documentation reproduced from package spatstat, version 1.52-1, License: GPL (>= 2)*