Learn R Programming

spatstat.linnet (version 3.2-2)

predict.lppm: Predict Point Process Model on Linear Network

Description

Given a fitted point process model on a linear network, compute the fitted intensity or conditional intensity of the model.

Usage

# S3 method for lppm
predict(object, ..., type = "trend",
                       locations = NULL, covariates = NULL,
                       se = FALSE,
                       new.coef=NULL)

Value

If se=FALSE (the default), the result is a pixel image (object of class "linim" and "im") or a list of pixel images, or a numeric vector, depending on the argument locations. See Details.

If se=TRUE, the result is a list of two elements, each with the format described above.

Arguments

object

The fitted model. An object of class "lppm", see lppm.

type

Type of values to be computed. Either "trend" or "cif". Currently ignored.

locations

Optional. Locations at which predictions should be computed. Either a data frame with two columns of coordinates, or a binary image mask.

covariates

Values of external covariates required by the model. Either a data frame, or a list of images and/or functions.

se

Logical value indicating whether to calculate standard errors as well.

new.coef

Optional. Numeric vector of model coefficients, to be used instead of the fitted coefficients coef(object) when calculating the prediction.

...

Optional arguments passed to as.mask to determine the pixel resolution (if locations is missing).

Author

Adrian Baddeley Adrian.Baddeley@curtin.edu.au

Details

This function computes the fitted point process intensity, optionally with standard errors, for a point process model on a linear network. It is a method for the generic predict for the class "lppm".

The argument object should be an object of class "lppm" (produced by lppm) representing a point process model on a linear network.

Currently the argument type has no effect. The fitted intensity is computed in all cases. This occurs because currently all fitted models of class "lppm" are Poisson point processes, where the trend, intensity, and conditional intensity are the same.

Predicted values are computed at the locations given by the argument locations. If this argument is missing, then predicted values are computed at a fine grid of points on the linear network.

  • If locations is missing or NULL (the default), the return value is a pixel image (object of class "linim" and "im") corresponding to a discretisation of the linear network, with numeric pixel values giving the predicted values at each location on the linear network. (If the model is multitype, the result is a list of such pixel images, one for each possible type of point.)

  • If locations is a data frame, the result is a numeric vector of predicted values at the locations specified by the data frame.

  • If locations is a binary mask, the result is a pixel image with predicted values computed at the pixels of the mask. (If the model is multitype, the result is a list of such pixel images, one for each possible type of point.)

If se=TRUE, standard errors are also computed. The result is a list of two elements, each following the format described above; the first element contains the fitted estimates, and the second element contains the standard errors.

References

Ang, Q.W. (2010) Statistical methodology for events on a network. Master's thesis, School of Mathematics and Statistics, University of Western Australia.

Ang, Q.W., Baddeley, A. and Nair, G. (2012) Geometrically corrected second-order analysis of events on a linear network, with applications to ecology and criminology. Scandinavian Journal of Statistics 39, 591--617.

Rakshit, S., McSwiggan, G., Nair, G. and Baddeley, A. (2021) Variable selection using penalised likelihoods for point patterns on a linear network. Australian and New Zealand Journal of Statistics 63. DOI 10.1111/anzs.12341.

Baddeley, A., Nair, G., Rakshit, S., McSwiggan, G. and Davies, T.M. (2021) Analysing point patterns on networks --- a review. Spatial Statistics 42, 100435.

See Also

lpp, linim

Examples

Run this code
  X <- runiflpp(12, simplenet)
  fit <- lppm(X ~ x)
  v <- predict(fit, type="trend")
  plot(v)

Run the code above in your browser using DataLab