homtestmap {spatstat.local} | R Documentation |
Test Statistic for Homogeneity Test
Description
Compute the test statistic for the test of homogeneity of a locally-fitted Poisson or Gibbs point process model.
Usage
homteststat(object, ..., verbose = FALSE)
homtestmap(object, ...,
what=c("components", "statistic", "pvalue"),
test = c("score", "taylor", "likelihood"),
ladjust=c("none", "moment", "PSS"),
calibrate=c("chisq", "Satterthwaite", "firstmoment"),
simple = !is.null(theta0),
theta0 = NULL,
poolmoments=NULL,
sigma = NULL,
saveall = FALSE,
use.fft = TRUE,
verbose = TRUE)
## S3 method for class 'homtestmap'
update(object, ...,
what=NULL, test=NULL, ladjust=NULL,
calibrate=NULL, saveall=FALSE, poolmoments=NULL)
Arguments
object |
Locally-fitted point process (object of class |
... |
For |
what |
Character string (partially matched)
indicating whether to return the vector components
of the local test statistic, or the value of the local test statistic, or
the local |
test |
Character string (partially matched)
indicating whether to perform
the local score test ( |
ladjust |
Character string (partially matched) specifying an adjustment to the composite likelihood ratio test statistic. |
calibrate |
Character string (partially matched)
specifying how to calculate |
simple |
Logical value indicating whether to treat the fitted model
as a simple null hypothesis ( |
theta0 |
Coefficient vector specifying a simple null hypothesis. |
poolmoments |
Logical value indicating how to calculate the reference distribution
for the likelihood ratio test statistic (and thus how to
calculate |
sigma |
Smoothing bandwidth. |
saveall |
Logical value indicating whether to compute a complete set of sufficient statistics and save them as an attribute of the result. See Details. |
use.fft |
For software testing purposes only. Logical value indicating whether to use data computed by the Fast Fourier Transform. |
verbose |
Logical value indicating whether to print progress reports. |
Details
These functions are used by homtest
to
perform 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 object
.
The function homtestmap
computes
either the local likelihood ratio test statistic
or the local score test statistic.
If what="statistic"
, then the result is a scalar-valued
function giving the local values of the test statistic.
If what="pvalue"
, the result is a scalar-valued function
giving the local
-value at each location
.
If
what="components"
, the result is a vector-valued
function containing the components of the quadratic form;
the squared norm of
is
equal to the desired test statistic at each location
.
If saveall=TRUE
, then a complete set of sufficient statistics is
calculated and stored as an attribute of the result. This makes it
possible to compute all of the statistics and values
described above.
The function update.homtestmap
, a method for the
generic function update
, converts
an object of class "homtestmap"
from one of these formats to
another, where possible. Except in trivial cases, this requires that
the "homtestmap"
object was computed with saveall=TRUE
.
The function homteststat
computes the mean of
the local test statistic or the mean
of the local -values over the
observation window.
To compute the -values when
test="likelihood"
or test="taylor"
, the values of the local likelihood ratio
test statistic are referred to a gamma distribution whose first two
moments are estimated from the data. If poolmoments=FALSE
,
the local estimates of the moments are used; if
poolmoments=TRUE
, the spatial average of these estimates
is used. The default is to use pooling whenever it is
theoretically justified, namely when the template
model is a stationary point process.
Finer control over the computation is possible
using the arguments ...
passed to locppm
.
Value
For homteststat
, a numeric value giving the test statistic.
For homtestmap
and update.homtestmap
,
a spatially-sampled function object (class "ssf"
; see
ssf
).
This object also belongs to the special class
"homtestmap"
which has a print method.
Author(s)
Adrian Baddeley Adrian.Baddeley@curtin.edu.au.
References
Baddeley, A. (2017) Local composite likelihood for spatial point patterns. Spatial Statistics 22, 261–295. DOI: 10.1016/j.spasta.2017.03.001
Baddeley, A., Rubak, E. and Turner, R. (2015) Spatial Point Patterns: Methodology and Applications with R. Chapman and Hall/CRC Press.
See Also
Examples
example(locppm)
plot(H <- homtestmap(fit))
H