plot a Fitted Point Process Model
Given a fitted point process model obtained by
create spatial trend and conditional intensity surfaces of the model,
in a form suitable for plotting, and (optionally) plot these
## S3 method for class 'ppm': plot(x, ngrid = c(40,40), superimpose = TRUE, trend = TRUE, cif = TRUE, pause = interactive(), how=c("persp","image", "contour"), plot.it = TRUE, locations = NULL, covariates=NULL, ...)
- A fitted point process model, typically obtained from
the model-fitting algorithm
ppm. An object of class
- The dimensions for a grid on which to evaluate,
for plotting, the spatial trend and conditional intensity.
A vector of 1 or 2 integers. If it is of length 1,
ngridis replaced by
- logical flag; if
plot=TRUE) the original data point pattern will be superimposed on the plots.
- logical flag; if
TRUE, the spatial trend surface will be produced.
- logical flag; if
TRUE, the conditional intensity surface will be produced.
- logical flag indicating whether to pause with a prompt
after each plot. Set
pause=FALSEif plotting to a file. (This flag is ignored if
- character string or character vector indicating the style or styles of
plots to be performed. Ignored if
- logical scalar; should a plot be produced immediately?
- If present, this determines the locations of the pixels
at which predictions are computed. It must be a binary pixel image
(an object of class
"mask"). (Incompatible with
- Values of external covariates required by the fitted model.
- extra arguments to the plotting functions
This is the
plot method for the class
ppm.object for details of this class).
predict.ppm to compute the spatial
trend and conditional intensity of the fitted point process model.
predict.ppm for more explanation about spatial trend
and conditional intensity.
The default action is to create a rectangular grid
of points in (the bounding box of) the observation window of
the data point pattern, and evaluate the spatial trend and
conditional intensity of the fitted spatial point process model
x at these locations. If the argument
is supplied, then the spatial trend
and conditional intensity are calculated at the grid of points
specified by this argument.
locations, if present, should be a
binary image mask (an object of class
"mask"). This determines a rectangular grid
of locations, or a subset of such a grid, at which predictions
will be computed. Binary image masks
are conveniently created using
covariates gives the values of any spatial covariates
at the prediction locations.
If the trend formula in the fitted model
involves spatial covariates (other than
the Cartesian coordinates
covariates is required.
covariates has the same format and interpretation
predict.ppm. It may be
either a data frame (the number of whose rows must match
the number of pixels in
locations multiplied by the number of
possible marks in the point pattern), or a list of images.
is not supplied, and
covariates is supplied, then
it must be a list of images.
If the fitted model was a marked (multitype) point process, then
predictions are made for each possible mark value in turn.
If the fitted model had no spatial trend, then the default is
to omit calculating this (flat) surface, unless
is set explicitly.
If the fitted model was Poisson, so that there were no spatial interactions,
then the conditional intensity and spatial trend are identical, and the
default is to omit the conditional intensity, unless
cif=TRUE is set
plot.plotppm() is called
upon to plot the class
plotppm object which is produced.
(That object is also returned, silently.)
Plots are produced successively using
contour (or only a
selection of these three, if
how is given). Extra
graphical parameters controlling the display may be passed
directly via the arguments
... or indirectly reset using
- An object of class
plotppm. Such objects may be plotted by
This is a list with components named
cif, either of which may be missing. They will be missing if the corresponding component does not make sense for the model, or if the corresponding argument was set equal to
cifare lists of images. If the model is an unmarked point process, then they are lists of length 1, so that
trend[]is an image of the spatial trend and
cif[]is an image of the conditional intensity.
If the model is a marked point process, then
trend[[i]]is an image of the spatial trend for the mark
cif[]is an image of the conditional intensity for the mark
mis the vector of levels of the marks.
See warnings in
data(cells) m <- ppm(cells, ~1, Strauss(0.05)) pm <- plot(m) # The object ``pm'' will be plotted as well as saved # for future plotting.