Conducts a Monte Carlo test of homogeneity for a locally-fitted Poisson or Gibbs point process model.
homtest(X, ..., nsim = 19,
test = c("residuals", "score", "taylor", "likelihood"),
locations = c("coarse", "fine", "split"),
ladjust = NULL,
use.fft = NULL,
simul = NULL,
verbose = TRUE, Xname = NULL)
An object of class "htest"
containing the test outcome.
A point pattern (object of class "ppp"
).
Additional arguments passed to locppm
to determine the
locally fitted model, and passed to ppm
to
determine the homogeneous model.
Number of simulations for the Monte Carlo test.
The local test statistic to be used:
either "likelihood"
for the local likelihood ratio test
statistic, "taylor"
for the Taylor approximation
to the local likelihood ratio test statistic,
"score"
for the local score test statistic,
or "residuals"
for the squared local residuals.
Arguments passed to locppm
to control the
calculation of variances (if method="local"
). See Details.
Optional argument passed to homtestmap
specifying a
data-dependent adjustment of the test statistic.
Optional information that determines
how to simulate the realisations from the null hypothesis.
An expression in the R language (that will be evaluated
nsim
times to obtain the simulated patterns), or a list
that contains the simulated point patterns.
Logical value indicating whether to print progress reports.
Optional character string name for the dataset X
,
to be printed in the test output.
Adrian Baddeley Adrian.Baddeley@curtin.edu.au.
This function performs a Monte Carlo test of the null hypothesis of homogeneity (i.e.\ constant parameter values) for the locally-fitted Poisson point process or Gibbs point process specified by the arguments.
The type of test is controlled by the argument test
.
test="likelihood"
:
the locally fitted model is computed as locppm(X, ...)
.
The local composite likelihood ratio test statistic of this model
is computed at each location,
and the mean of this statistic over the window is computed.
test="taylor"
:
the locally fitted model is computed as locppm(X, ...)
.
The Taylor approximation to the
local composite likelihood ratio test statistic of this model
is computed at each location,
and the mean of this statistic over the window is computed.
test="score"
:
the locally fitted model is computed as locppm(X, ...)
.
The local score test statistic of this model is computed at each location,
and the mean of this statistic over the window is computed.
method="residuals"
:
the homogeneous model is fitted as ppm(X, ...)
.
The smoothed score residuals of this model are computed at each
location, and the mean of the squared norm over the window
is computed.
The test statistic is computed for the data pattern X
and for each of nsim
simulated realisations from the
homogeneous model. The Monte Carlo \(p\)-value is computed.
Baddeley, A. (2017) Local composite likelihood
Baddeley, A., Rubak, E. and Turner, R. (2015) Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press.
To compute the test statistic only, see
homtestmap
.
if (FALSE) {
homtest(swedishpines)
}
# \testonly{
homtest(swedishpines, nd=5, nsim=5)
# }
Run the code above in your browser using DataLab