Given a point process model fitted to a point pattern dataset,
this function computes the compensator
of the
Kcom(object, r = NULL, breaks = NULL, ...,
correction = c("border", "isotropic", "translate"),
conditional = !is.poisson(object),
restrict = FALSE,
model = NULL,
trend = ~1, interaction = Poisson(), rbord = reach(interaction),
compute.var = TRUE,
truecoef = NULL, hi.res = NULL)
Object to be analysed.
Either a fitted point process model (object of class "ppm"
)
or a point pattern (object of class "ppp"
)
or quadrature scheme (object of class "quad"
).
Optional.
Vector of values of the argument
This argument is for advanced use only.
Ignored.
Optional vector of character strings specifying the edge
correction(s) to be used. See Kest
for options.
Optional. Logical value indicating whether to compute the estimates for the conditional case. See Details.
Logical value indicating
whether to compute the restriction estimator (restrict=TRUE
) or
the reweighting estimator (restrict=FALSE
, the default).
Applies only if conditional=TRUE
.
See Details.
Optional. A fitted point process model (object of
class "ppm"
) to be re-fitted to the data
using update.ppm
, if object
is a point pattern.
Overrides the arguments trend,interaction,rbord
.
Logical value indicating whether to compute the
Poincare variance bound for the residual
Optional. Numeric vector. If present, this will be treated as
if it were the true coefficient vector of the point process model,
in calculating the diagnostic. Incompatible with hi.res
.
Optional. List of parameters passed to quadscheme
.
If this argument is present, the model will be
re-fitted at high resolution as specified by these parameters.
The coefficients
of the resulting fitted model will be taken as the true coefficients.
Then the diagnostic will be computed for the default
quadrature scheme, but using the high resolution coefficients.
A function value table (object of class "fv"
),
essentially a data frame of function values.
There is a plot method for this class. See fv.object
.
This command provides a diagnostic for the goodness-of-fit of
a point process model fitted to a point pattern dataset.
It computes an estimate of the
The first argument, object
, is usually a fitted point process model
(object of class "ppm"
), obtained from the
model-fitting function ppm
.
For convenience, object
can also be a point pattern
(object of class "ppp"
). In that case, a point process
model will be fitted to it, by calling ppm
using the arguments
trend
(for the first order trend),
interaction
(for the interpoint interaction)
and rbord
(for the erosion distance in the border correction
for the pseudolikelihood). See ppm
for details
of these arguments.
The algorithm first extracts the original point pattern dataset
(to which the model was fitted) and computes the
standard nonparametric estimates of the "fv"
).
The argument correction
determines the edge correction(s)
to be applied. See Kest
for explanation of the principle
of edge corrections. The following table gives the options
for the correction
argument, and the corresponding
column names in the result:
correction |
description of correction | nonparametric | compensator |
"isotropic" |
Ripley isotropic correction | iso |
icom |
"translate" |
Ohser-Stoyan translation correction | trans |
tcom |
The nonparametric estimates can all be expressed in the form
If the fitted model is a Poisson point process, then the formulae above are exactly what is computed. If the fitted model is not Poisson, the formulae above are modified slightly to handle edge effects.
The modification is determined by the arguments
conditional
and restrict
.
The value of conditional
defaults to FALSE
for Poisson models
and TRUE
for non-Poisson models.
If conditional=FALSE
then the formulae above are not modified.
If conditional=TRUE
, then the algorithm calculates
the restriction estimator if restrict=TRUE
,
and calculates the reweighting estimator if restrict=FALSE
.
See Appendix D of Baddeley, Rubak and Moller (2011).
Thus, by default, the reweighting estimator is computed
for non-Poisson models.
The nonparametric estimates of
Baddeley, A., Rubak, E. and Moller, J. (2011) Score, pseudo-score and residual diagnostics for spatial point process models. Statistical Science 26, 613--646.
Related functions:
Kres
,
Kest
.
Alternative functions:
Gcom
,
psstG
, psstA
, psst
.
Point process models: ppm
.
# NOT RUN {
fit0 <- ppm(cells, ~1) # uniform Poisson
# }
# NOT RUN {
if(interactive()) {
plot(Kcom(fit0))
# compare the isotropic-correction estimates
plot(Kcom(fit0), cbind(iso, icom) ~ r)
# uniform Poisson is clearly not correct
}
fit1 <- ppm(cells, ~1, Strauss(0.08))
# }
# NOT RUN {
K1 <- Kcom(fit1)
K1
if(interactive()) {
plot(K1)
plot(K1, cbind(iso, icom) ~ r)
plot(K1, cbind(trans, tcom) ~ r)
# how to plot the difference between nonparametric estimates and compensators
plot(K1, iso - icom ~ r)
# fit looks approximately OK; try adjusting interaction distance
}
fit2 <- ppm(cells, ~1, Strauss(0.12))
# }
# NOT RUN {
K2 <- Kcom(fit2)
if(interactive()) {
plot(K2)
plot(K2, cbind(iso, icom) ~ r)
plot(K2, iso - icom ~ r)
}
# }
Run the code above in your browser using DataLab