Prediction from a Fitted Point Process Model
Given a fitted point process model obtained by
evaluate the spatial trend and the conditional intensity of the model
at new locations.
predict.ppm(object, window, ngrid=NULL, type="trend") predict.ppm(object, newdata, type="trend")
- A fitted point process model, typically obtained from
the maximum pseudolikelihood algorithm
mpl. An object of class
- optional data frame giving the values of any spatial covariates
for the locations at which predictions should be
computed. (Incompatible with
- window delimiting the locations where predictions
should be computed. Defaults to the window of the
original data used to fit the model
object. (Incompatible with
- dimensions (either (
ngrid) of a rectangular grid of locations inside
windowwhere predictions should be computed. (Incompatible with
- character string.
Indicates which property of the fitted model should be predicted.
"trend"for the spatial trend, and
"lambda"for the conditional intensity.
This function computes the spatial trend
and the conditional intensity of a fitted spatial point process model.
See Baddeley and Turner (2000) for explanation and examples.
Given a point pattern dataset, we may fit
a point process model to the data using the
maximum pseudolikelihood algorithm
returns an object of class
the fitted point process model (see
The parameter estimates in this fitted model can be read off
simply by printing the
The spatial trend and conditional intensity of the
fitted model are evaluated using this function
This is feasible in such generality because the Berman-Turner-Baddeley method
(Berman and Turner, 1992; Baddeley and Turner, 2000)
reduces maximum pseudolikelihood estimation to the fitting
of a GLM or GAM, and because Splus/Rcontains
predict methods for
gam objects. The current implementation
The default action is to create a rectangular grid of points
in the observation window of the data point pattern, and evaluate
the spatial trend and conditional intensity at these locations.
Note that by ``spatial trend'' we mean the
(exponentiated) first order potential
and not the intensity of the process. [For example if we fit the
stationary Strauss process with parameters
$\beta$ and $\gamma$,
then the spatial trend is constant and equal to $\beta$. ]
The conditional intensity $\lambda(u, X)$ of the
fitted model is evaluated at each required spatial location $u$,
with respect to the data point pattern $X$.
newdata, if given, is a data frame
giving the values of any spatial covariates
at the locations where the trend and conditional intensity should be
If the trend formula in the fitted model
involves spatial covariates (other than
the Cartesian coordinates
newdata is required.
newdata is present then it must contain variables
matching all the variable names featuring in the trend formula
and the Cartesian coordinates
and the mark values
[This is different from the role of the
mpl which must not contain
Note that if you only want to use prediction in order to
generate a plot of the predicted values,
it may be easier to use
plot.ppm which calls
this function and plots the results.
newdatais given: a vector of predicted values for the spatial locations (and marks and covariates) given in the rows of
newdatais not given: If
objectis an unmarked point process, the result is an image object (of class
im.object) containing the predictions. If
objectis a multitype point process, the result is a list of images, containing the predictions for each type at the same grid of locations.
The ``predicted values'' are either values of the spatial trend (if
type="trend") or values of the conditional intensity (if
predict.ppm(object, newdata, window, ngrid=NULL, type="trend",...)
The current implementation invokes
so that prediction is wrong if the trend formula in
object involves terms in
This is a weakness of
Error messages may be very opaque,
as they tend to come from deep in the workings of
If you are passing the
and the function crashes,
it is advisable to start by checking that all the conditions
listed above are satisfied.
Baddeley, A. and Turner, R. Practical maximum pseudolikelihood for spatial point patterns. Australian and New Zealand Journal of Statistics 42 (2000) 283--322. Berman, M. and Turner, T.R. Approximating point process likelihoods with GLIM. Applied Statistics 41 (1992) 31--38.
library(spatstat) data(cells) m <- mpl(cells, ~ polynom(x,y,2), Strauss(0.05), rbord=0.05) trend <- predict(m, type="trend") image(trend) points(cells) cif <- predict(m, type="cif") persp(cif)