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.
model.images(object, ...) ## 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 'dppm' model.images(object, W = as.owin(object), ...) ## S3 method for class 'slrm' model.images(object, ...)
object |
The fitted point process model. An object of class |
W |
A window (object of class |
... |
Other arguments (such as |
This command is similar to model.matrix.ppm
except
that it computes pixel images of the covariates,
instead of computing the covariate values at certain points only.
The spatial covariates required by the model-fitting procedure
are computed at every pixel location in the window W
.
For slrm
objects, the
covariates are computed on the pixels that were used to fit the
model.
Note that the spatial covariates computed here are not necessarily the original covariates that were supplied when fitting the model. Rather, they are the canonical covariates, the covariates that 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
if W
is a mask (that is W$type = "mask"
).
Otherwise, the pixel resolution is determined by
spatstat.options
.
The format of the result depends on whether the original point pattern data were marked or unmarked.
If the original dataset was unmarked,
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
determined by model.matrix.lm
.
The result is also of class "solist"
so that it can
be plotted immediately.
If the original dataset was a multitype point pattern,
the result is a hyperframe
with one column for each possible type of points.
Each column is a named list of pixel images (objects of class
"im"
) containing the values of the spatial covariates.
The row names of the hyperframe are the names of the covariates
determined by model.matrix.lm
.
A list (of class "solist"
) or
array (of class "hyperframe"
) containing
pixel images (objects of class "im"
).
Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.
fit <- ppm(cells ~ x) model.images(fit) B <- owin(c(0.2, 0.4), c(0.3, 0.8)) model.images(fit, B) fit2 <- ppm(cells ~ cut(x,3)) model.images(fit2) fit3 <- slrm(japanesepines ~ x) model.images(fit3) fit4 <- ppm(amacrine ~ marks + x) model.images(fit4)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.