
## S3 method for class 'ppm':
residuals(object, type="raw", \dots, check=TRUE, drop=FALSE,
fittedvalues=fitted.ppm(object, check=check, drop=drop))
"ppm"
)
for which residuals should be calculated."raw"
, "inverse"
and "pearson"
.
A partial match is adequate.object
. If there is any possibility that this object
has been restored from a dump file, or has otherwise lost track of
the environment where it was originally compuquad.ppm
for
explanation.object
by union.quad(quad.ppm(object))
.diagnose.ppm
to produce diagnostic plots
based on these residuals. The argument object
must be a fitted point process model
(object of class "ppm"
). Such objects are produced by the maximum
pseudolikelihood fitting algorithm ppm
).
This fitted model object contains complete
information about the original data pattern.
Residuals are attached both to the data points and to some
other points in the window of observation (namely, to the dummy
points of the quadrature scheme used to fit the model).
If the fitted model is correct, then the sum of the
residuals over all (data and dummy) points in a spatial region $B$
has mean zero. For further explanation, see Baddeley et al (2005).
The type of residual
is chosen by the argument type
. Current options are
[object Object],[object Object],[object Object]
Use diagnose.ppm
to produce diagnostic plots
based on these residuals.
diagnose.ppm
,
ppm.object
,
ppm
data(cells)
fit <- ppm(cells, ~x, Strauss(r=0.15))
rp <- residuals.ppm(fit, type="pe")
sum(rp) # should be close to 0
# extract quadrature points to which the residuals correspond
quadpoints <- union.quad(quad.ppm(fit))
# plot residuals as marks attached to the quadrature points
quadmarked <- setmarks(quadpoints, rp)
plot(quadmarked)
Run the code above in your browser using DataLab