predict.sphppm | R Documentation |
Given a point process model fitted to spherical point pattern data, this function computes predictions of the model such as the fitted intensity.
## S3 method for class 'sphppm' predict(object, newdata = NULL, type = c("intensity", "link", "terms"), ...)
object |
The fitted model. An object of class |
newdata |
Optional. New data specifying locations where predictions should be
computed. Either a spherical point pattern (class |
type |
Type of prediction: |
... |
Ignored. |
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.
Numeric vector or matrix.
Adrian Baddeley
sphppm
,
fitted.sphppm
.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.