dg.test(X, ..., exponent = 2, nsim=19, nsimsub=nsim-1, alternative=c("two.sided", "less", "greater"), reuse = TRUE, leaveout=1, interpolate = FALSE, savefuns=FALSE, savepatterns=FALSE, verbose = TRUE)
"ppp"
,
"lpp"
or "pp3"
) or a fitted point process model
(object of class "ppm"
, "kppm"
, "lppm"
or "slrm"
).
exponent=2
for the Diggle-Cressie-Loosmore-Ford test, and exponent=Inf
for the Maximum Absolute Deviation test.
nsim
repetitions of the basic test, each involving nsimsub
simulated
realisations, so there will be a total
of nsim * (nsimsub + 1)
simulations.
alternative="two.sided"
) is that the
true value of the summary function is not equal to the theoretical
value postulated under the null hypothesis.
If alternative="less"
the alternative hypothesis is that the
true value of the summary function is lower than the theoretical value.
"htest"
which can be printed to show the outcome of the test.
X
is a point pattern, the null hypothesis is CSR. If X
is a fitted model, the null hypothesis is that model.
The argument use.theory
passed to envelope
determines whether to compare the summary function for the data
to its theoretical value for CSR (use.theory=TRUE
)
or to the sample mean of simulations from CSR
(use.theory=FALSE
).
The argument leaveout
specifies how to calculate the
discrepancy between the summary function for the data and the
nominal reference value, when the reference value must be estimated
by simulation. The values leaveout=0
and
leaveout=1
are both algebraically equivalent (Baddeley et al, 2014,
Appendix) to computing the difference observed - reference
where the reference
is the mean of simulated values.
The value leaveout=2
gives the leave-two-out discrepancy
proposed by Dao and Genton (2014).
Baddeley, A., Hardegen, A., Lawrence, L., Milne, R.K., Nair, G.M. and Rakshit, S. (2015) Pushing the envelope: extensions of graphical Monte Carlo tests. Submitted for publication.
dclf.test
,
mad.test
ns <- if(interactive()) 19 else 4
dg.test(cells, nsim=ns)
dg.test(cells, alternative="less", nsim=ns)
dg.test(cells, nsim=ns, interpolate=TRUE)
Run the code above in your browser using DataLab