envelope.sphere | R Documentation |
envelope.sp2
computes simulation envelopes of a summary function
for a point pattern on a sphere; envelope.sphppm
computes simulation envelopes of a summary function,
based on a fitted point process model, for a point pattern on a sphere.
## S3 method for class 'sp2' envelope(Y, fun=Ksphere, nsim=99, nrank=1, ..., funargs=list(), simulate=NULL, fix.n=FALSE, verbose=TRUE, transform=NULL,global=FALSE,ginterval=NULL,use.theory=NULL, alternative=c("two.sided", "less", "greater"), scale=NULL, clamp=FALSE, savefuns=FALSE, savepatterns=FALSE, nsim2=nsim, VARIANCE=FALSE, nSD=2, Yname=NULL, maxnerr=nsim, do.pwrong=FALSE, envir.simul=NULL) ## S3 method for class 'sphppm' envelope(Y, fun = Ksphere, nsim = 99, nrank = 1, ..., funargs = list(), simulate = NULL, fix.n = FALSE, verbose = TRUE, transform = NULL, global = FALSE, ginterval = NULL, use.theory = NULL, alternative = c("two.sided", "less", "greater"), scale = NULL, clamp = FALSE, savefuns = FALSE, savepatterns = FALSE, nsim2 = nsim, VARIANCE = FALSE, nSD = 2, Yname = NULL, maxnerr = nsim, do.pwrong = FALSE, envir.simul = NULL)
Y |
A spherical point pattern (object of class
|
fun |
Function that computes the desired summary statistic for a spherical point pattern. |
nsim |
Number of simulated point patterns to be generated when computing the envelopes. |
nrank |
Integer. Rank of the envelope value amongst the |
... |
Extra arguments passed to |
funargs |
A list, containing extra arguments to be passed to |
simulate |
Optional. Specifies how to generate the simulated point patterns.
If |
fix.n |
Logical flag indicating whether to generate simulations with the
same number of points as in |
verbose |
Logical flag indicating whether to print progress reports during the simulations. |
transform |
Optional. A transformation to be applied to the function values, before the envelopes are computed. An expression object (see Details). |
global |
Logical flag indicating whether envelopes should be pointwise
( |
ginterval |
Optional.
A vector of length 2 specifying
the interval of r values for the simultaneous critical
envelopes. Only relevant if |
use.theory |
Logical value indicating whether to use the theoretical value,
computed by |
alternative |
Character string determining whether the envelope corresponds
to a two-sided test ( |
scale |
Optional. Scaling function for global envelopes.
A function in the R language which determines the
relative scale of deviations, as a function of
distance r, when computing the global envelopes.
Applicable only when |
clamp |
Logical value indicating how to compute envelopes when
|
savefuns |
Logical flag indicating whether to save all the simulated function values. |
savepatterns |
Logical flag indicating whether to save all the simulated point patterns. |
nsim2 |
Number of extra simulated point patterns to be generated
if it is necessary to use simulation to estimate the theoretical
mean of the summary function. Only relevant when |
VARIANCE |
Logical. If |
nSD |
Number of estimated standard deviations used to determine
the critical envelopes, if |
Yname |
Character string that should be used as the name of the
data point pattern |
maxnerr |
Maximum number of rejected patterns.
If |
do.pwrong |
Logical. If |
envir.simul |
Environment in which to evaluate the expression |
The envelope
command performs simulations and
computes envelopes of a summary statistic based on the simulations.
The result is an object that can be plotted to display the envelopes.
The envelopes can be used to assess the goodness-of-fit of
a point process model to point pattern data.
The envelope
function is generic, with methods for
the classes "ppp"
, "ppm"
and "kppm"
described in the help file for envelope
.
The function envelope.sp2
is the method for
spherical point patterns (objects of class "sp2"
), and the function envelope.sphppm
is the method for
point process models fitted to spherical point patterns
(objects of class "sphppm"
).
For the most basic use, if you have a spherical point pattern X
and
you want to test Complete Spatial Randomness (CSR), type
plot(envelope(X, Ksphere,nsim=39))
to see the spherical
K function for X
plotted together with the envelopes of
the spherical K function for 39 simulations of CSR.
However, if you have fitted a model M
to
spherical point pattern data and you want to test the goodness-of-fit
of the model, simply do plot(envelope(M, nsim=39))
to display pointwise envelopes or
plot(envelope(M, nsim=19, global=TRUE))
for global envelopes.
Both displays can be interpreted as performing a Monte Carlo test with
significance level 0.05.
To create simulation envelopes, the command envelope(Y, ...)
first generates nsim
random point patterns
in one of the following ways.
If simulate=NULL
,
then we generate nsim
simulations of
Complete Spatial Randomness (i.e. nsim
simulated point patterns
each being a realisation of the uniform Poisson point process)
with the same intensity as the pattern Y
.
If simulate
is supplied, then it determines how the
simulated point patterns are generated.
See envelope
for details.
The summary statistic fun
is applied to each of these simulated
patterns. Typically fun
is one of the functions
Ksphere
, Gsphere
,
Fsphere
or Jsphere
.
It may also be a character string
containing the name of one of these functions.
For further information, see the documentation for
envelope
.
A function value table (object of class "fv"
)
which can be plotted directly.
See envelope
for further details.
Adrian Baddeley Adrian.Baddeley@uwa.edu.au http://www.maths.uwa.edu.au/~adrian/ and Rolf Turner r.turner@auckland.ac.nz
Baddeley, A., Diggle, P.J., Hardegen, A., Lawrence, T., Milne, R.K. and Nair, G. (2014) On tests of spatial pattern based on simulation envelopes. Ecological Monographs, 84(3) 477–489
Cressie, N.A.C. Statistics for spatial data. John Wiley and Sons, 1991.
Diggle, P.J. Statistical analysis of spatial point patterns. Arnold, 2003.
Lawrence, T.J. (2017) Master's Thesis, University of Western Australia.
Ripley, B.D. (1981) Spatial statistics. John Wiley and Sons.
Ripley, B.D. Statistical inference for spatial processes. Cambridge University Press, 1988.
Stoyan, D. and Stoyan, H. (1994) Fractals, random shapes and point fields: methods of geometrical statistics. John Wiley and Sons.
sp2
,
runif.sphwin
,
rpoispp.sphwin
,
Ksphere
,
Fsphere
,
Gsphere
,
Jsphere
.
X <- runif.sphwin(30) # envelopes of Ripley's K for this pattern EX <- envelope(X, Ksphere, nsim=39) plot(EX) M <- sphppm(X ~ x1+x2+x3) # envelopes of Ripley's K for this model EM <- envelope(M, Ksphere, nsim=19) plot(EM) # envelopes of inhomogeneous K, using correctly-updated intensities EM2 <- envelope(M, Ksphere, lambdavalues=M, nsim=19)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.