Computes the (maximised) loglikelihood of a fitted Spatial Logistic Regression model.
# S3 method for slrm
logLik(object, ..., adjust = TRUE)
a fitted spatial logistic regression model.
An object of class "slrm"
.
Ignored.
Logical value indicating whether to adjust the loglikelihood of the model to make it comparable with a point process likelihood. See Details.
A numerical value.
This is a method for logLik
for fitted spatial logistic
regression models (objects of class "slrm"
, usually obtained
from the function slrm
). It computes the log-likelihood
of a fitted spatial logistic regression model.
If adjust=FALSE
, the loglikelihood is computed
using the standard formula for the loglikelihood of a
logistic regression model for a finite set of (pixel) observations.
If adjust=TRUE
then the loglikelihood is adjusted so that it
is approximately comparable with the likelihood of a point process
in continuous space, by subtracting the value
# NOT RUN {
X <- rpoispp(42)
fit <- slrm(X ~ x+y)
logLik(fit)
logLik(fit, adjust=FALSE)
# }
Run the code above in your browser using DataLab