predict.sphppm: Compute Predictions of Fitted Point Process Model on Sphere

View source: R/sphppm.R

predict.sphppmR Documentation

Compute Predictions of Fitted Point Process Model on Sphere

Description

Given a point process model fitted to spherical point pattern data, this function computes predictions of the model such as the fitted intensity.

Usage

## S3 method for class 'sphppm'
predict(object,
                         newdata = NULL,
                         type = c("intensity", "link", "terms"), ...)

Arguments

object

The fitted model. An object of class "sphppm" usually obtained from sphppm.

newdata

Optional. New data specifying locations where predictions should be computed. Either a spherical point pattern (class "sp2" or "sp3") or a data frame. See Details.

type

Type of prediction: "intensity" to compute the fitted intensity, "link" to compute the fitted log intensity, or "terms" to evaluate each of the covariate terms in the model.

...

Ignored.

Details

This is the method for the generic function predict for the class "sphppm" of fitted point process models on a sphere.

Without additional arguments, predict(object) is equivalent to fitted(object) and computes the fitted intensity at each of the data points to which the model was originally fitted.

By specifying newdata the user can evaluate the predictions of the model at other locations. Here newdata should be either a spherical point pattern (class "sp2" or "sp3") or a data frame with columns named "theta", "phi", "x1", "x2" and "x3" giving the angular and Cartesian coordinates of the locations where prediction is required.

Value

Numeric vector or matrix.

Author(s)

Adrian Baddeley

See Also

sphppm, fitted.sphppm.

Examples

   W <- sphwin(type="band", param=c(pi/3, 2*pi/3), ref=c(0,0))
   Z <- runif.sphwin(100, W)
   fut <- sphppm(Z ~ x1 + x2 + x3)
   a <- predict(fut)
   a[1:10]
   b <- predict(fut, type="terms")
   b[1:5,]

   U <- runif.sphwin(3, W)
   predict(fut, newdata=U)
   predict(fut, newdata=U, type="terms")

baddstats/spherstat documentation built on Feb. 6, 2023, 1:45 a.m.