Compute Images of Constructed Covariates
For a point process model fitted to spatial point pattern data, this function computes pixel images of the covariates in the design matrix.
## S3 method for class 'ppm': model.images(object, W = as.owin(object), ...)
## S3 method for class 'kppm': model.images(object, W = as.owin(object), ...)
## S3 method for class 'lppm': model.images(object, L = as.linnet(object), ...)
## S3 method for class 'slrm': model.images(object, ...)
- The fitted point process model. An object of class
- A window (object of class
"owin") in which the images should be computed. Defaults to the window in which the model was fitted.
- A linear network (object of class
"linnet") in which the images should be computed. Defaults to the network in which the model was fitted.
- Other arguments (such as
na.action) passed to
This command is similar to
that it computes pixel images of the covariates,
instead of computing the covariate values at certain points only.
object must be a fitted spatial point process model
object of class
"ppm" (produced by the model-fitting
ppm) or class
"kppm" (produced by the
kppm) or class
lppm) or class
"slrm" (produced by
The spatial covariates required by the model-fitting procedure
are computed at every pixel location in the window
lppm objects, the covariates are computed at every
location on the network
slrm objects, the
covariates are computed on the pixels that were used to fit the
Note that the spatial covariates computed here are not the original covariates that were supplied when fitting the model. Rather, they are the covariates that actually appear in the loglinear representation of the (conditional) intensity and in the columns of the design matrix. For example, they might include dummy or indicator variables for different levels of a factor, depending on the contrasts that are in force.
The pixel resolution is determined by
W is a mask (that is
W$type = "mask").
Otherwise, the pixel resolution is determined by
The result is a named list of pixel images (objects of class
"im") containing the values of the spatial covariates.
The names of the list elements are the names of the covariates
The result is also of class
"listof" so that it can
be plotted immediately.
- An object of class
"listof"consisting of a named list of pixel images (objects of class
"im"). This list can be plotted immediately using
model.images.lppm, the images are also of class
fit <- ppm(cells, ~x) model.images(fit) fit2 <- ppm(cells, ~cut(x,3)) model.images(fit2) fit3 <- slrm(japanesepines ~ x) model.images(fit3)