fitted.slrm: Fitted Probabilities for Spatial Logistic Regression

View source: R/slrm.R

fitted.slrmR Documentation

Fitted Probabilities for Spatial Logistic Regression

Description

Given a fitted Spatial Logistic Regression model, this function computes the fitted probabilities for each pixel, or the fitted probabilities at each original data point.

Usage

  ## S3 method for class 'slrm'
fitted(object, ..., type="probabilities",
                 dataonly=FALSE, leaveoneout=FALSE)

Arguments

object

a fitted spatial logistic regression model. An object of class "slrm".

...

Ignored.

type

Character string (partially) matching one of "probabilities", "intensity" or "link" determining the quantity that should be predicted.

dataonly

Logical. If TRUE, then values will only be computed at the points of the data point pattern. If FALSE, then values will be computed at the pixels used to fit the model.

leaveoneout

Logical value specifying whether to perform a leave-one-out calculation when dataonly=TRUE. If leaveoneout=TRUE, the fitted value at each data point X[i] is calculated by re-fitting the model to the data with X[i] removed.

Details

This is a method for the generic function fitted for spatial logistic regression models (objects of class "slrm", usually obtained from the function slrm).

By default, the algorithm computes the fitted probabilities of the presence of a random point in each pixel, and returns them as an image.

If dataonly=TRUE, the algorithm computes the fitted presence probabilities only at the locations of the original data points.

Value

A pixel image (object of class "im") containing the fitted probability for each pixel, or a numeric vector containing the fitted probability at each data point.

Author(s)

\adrian

and \rolf.

See Also

slrm, fitted

Examples

  X <- rpoispp(42)
  fit <- slrm(X ~ x+y)
  plot(fitted(fit))
  fitted(fit, dataonly=TRUE)

spatstat.model documentation built on Sept. 11, 2024, 9:07 p.m.