"envelope"(Y, fun=K3est, nsim=99, nrank=1, ..., funargs=list(), funYargs=funargs, simulate=NULL, 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)
"pp3"
).
nsim
simulated
values. A rank of 1 means that the minimum and maximum
simulated values will be used.
fun
.
fun
.
fun
when applied to the original data Y
only.
simulate
is an expression in the R language, then this
expression will be evaluated nsim
times,
to obtain nsim
point patterns which are taken as the
simulated patterns from which the envelopes are computed.
If simulate
is a list of point patterns, then the entries
in this list will be treated as the simulated patterns from which
the envelopes are computed.
Alternatively simulate
may be an object produced by the
envelope
command: see Details.
global=FALSE
) or simultaneous (global=TRUE
).
global=TRUE
.
fun
, as the reference value for simultaneous
envelopes. Applicable only when global=TRUE
.
side="two.sided"
, the default)
or a one-sided test with a lower critical boundary
(side="less"
) or a one-sided test
with an upper critical boundary (side="greater"
).
global=TRUE
.
Summary function values for distance r
will be divided by scale(r)
before the
maximum deviation is computed. The resulting global envelopes
will have width proportional to scale(r)
.
alternative="less"
or alternative="greater"
.
Deviations of the observed
summary function from the theoretical summary function are initially
evaluated as signed real numbers, with large positive values indicating
consistency with the alternative hypothesis.
If clamp=FALSE
(the default), these values are not changed.
If clamp=TRUE
, any negative values are replaced by zero.
global=TRUE
and the simulations are not based on CSR.
TRUE
, critical envelopes will be calculated
as sample mean plus or minus nSD
times sample standard
deviation.
VARIANCE=TRUE
.
Y
when printing or plotting the results.
fun
yields an error when applied to a simulated point
pattern (for example, because the pattern is empty and fun
requires at least one point), the pattern will be rejected
and a new random point pattern will be generated. If this happens
more than maxnerr
times, the algorithm will give up.
TRUE
, the algorithm will also estimate
the true significance level of the wrong test (the test that
declares the summary function for the data to be significant
if it lies outside the pointwise critical boundary at any
point). This estimate is printed when the result is printed.
simulate
,
if not the current environment.
"fv"
)
which can be plotted directly.
See envelope
for further details.
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
.
This function envelope.pp3
is the method for
three-dimensional point patterns (objects of class "pp3"
).
For the most basic use, if you have a 3D point pattern X
and
you want to test Complete Spatial Randomness (CSR), type
plot(envelope(X, K3est,nsim=39))
to see the three-dimensional
$K$ function for X
plotted together with the envelopes of
the three-dimensional $K$ function for 39 simulations of CSR.
To create simulation envelopes, the command envelope(Y, ...)
first generates nsim
random point patterns
in one of the following ways.
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
.
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
K3est
, G3est
, F3est
or pcf3est
.
It may also be a character string
containing the name of one of these functions.
For further information, see the documentation for
envelope
.
pp3
,
rpoispp3
,
K3est
,
G3est
,
F3est
,
pcf3est
.
X <- rpoispp3(20, box3())
## Not run:
# plot(envelope(X, nsim=39))
# ## End(Not run)
Run the code above in your browser using DataLab