| fitted.slrm | R Documentation |
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.
## S3 method for class 'slrm'
fitted(object, ..., type="probabilities",
dataonly=FALSE, leaveoneout=FALSE)
object |
a fitted spatial logistic regression model.
An object of class |
... |
Ignored. |
type |
Character string (partially) matching one of
|
dataonly |
Logical. If |
leaveoneout |
Logical value specifying whether to perform a leave-one-out calculation. See 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 fitted presence probabilities in each pixel are computed and returned as a pixel image.
If dataonly=FALSE (the default), a value is computed
for each pixel in a fine grid.
If dataonly=TRUE, a value is computed for each
of the points in the original spatial point pattern.
If leaveoneout=FALSE (the default), fitted values are extracted
from the fitted model object.
If leaveoneout=TRUE, then a leave-one-out calculation is
performed:
If dataonly=FALSE and leaveoneout=TRUE,
the predicted value in each pixel is computed using a leave-one-out
calculation. At each pixel j, the model is re-fitted using all the
data except the data inside pixel j, and this updated model is
then predicted using the data inside pixel j.
(‘Leave one pixel out’)
If dataonly=TRUE and leaveoneout=TRUE,
the predicted value for each data point X[i] is calculated
by re-fitting the model to the data with X[i] removed,
and then predicting this model at location X[i].
(‘Leave one point out’)
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.
.
slrm,
fitted
X <- rpoispp(42)
fit <- slrm(X ~ x+y)
plot(fitted(fit))
fitted(fit, dataonly=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.