dg.combined_global_envelope: Adjusted combined global envelope tests

Description Usage Arguments Details Value References See Also

Description

Adjusted combined global rank envelope test, studentized envelope test or directional quantile envelope test.

Usage

1
2
3
4
5
6
dg.combined_global_envelope(X, nsim = 499, nsimsub = nsim, simfun = NULL,
  fitfun = NULL, ..., testfuns = NULL, test = c("qdir", "st", "rank"),
  alpha = 0.05, alternative = c("two.sided", "less", "greater"),
  r_min = NULL, r_max = NULL, take_residual = FALSE,
  save.cons.envelope = savefuns || savepatterns, savefuns = FALSE,
  savepatterns = FALSE, verbose = TRUE, mc.cores = 1L)

Arguments

X

An object containing point pattern data. A point pattern (object of class "ppp") or a fitted point process model (object of class "ppm" or "kppm"). See envelope.

nsim

The number of simulations.

nsimsub

Number of simulations in each basic test. There will be nsim repetitions of the basic test, each involving nsimsub simulated realisations, so there will be a total of nsim * (1 + nsimsub) simulations.

simfun

A function for generating simulations from the null model. If given, this function is called by replicate(n=nsim, simfun(simfun.param), simplify=FALSE) to make nsim simulations. The function should return an ppp object as those are further passed to envelope. If the function is not provided, then envelope is used also for generating the point patterns from the null hypothesis.

fitfun

A function for estimating the parameters of the null model. If not given, then envelope takes care of the parameter estimation as well (and X should be a fitted model object). The function 'fitfun' should return the fitted model in the form that it can be directly passed to 'simfun' as the argument 'simfun.arg'.

...

Additional parameters passed to envelope. For example, the test function in the argument 'fun' and further specifications regarding that. If envelope is also used to generate simulations under the null hypothesis (if simfun not provided), then also recall to specify how to generate the simulations.

testfuns

A list of lists of parameters to be passed to envelope. A list of parameters should be provided for each test function that is to be used in the combined test.

test

Either "rank" for the rank_envelope test, "qdir" for the qdir_envelope test or "st" for the st_envelope test.

alpha

The significance level. The 100(1-alpha)% global envelope will be calculated.

alternative

A character string specifying the alternative hypothesis. Must be one of the following: "two.sided" (default), "less" or "greater" for "rank". Relevant only for the rank test (otherwise ignored).

r_min

The minimum radius to include in the test.

r_max

The maximum radius to include in the test. Note: cannot be larger than r-values used in calculating functions by envelope.

take_residual

If (needed for visual reasons only) the theoretical or mean behaviour of the test function is reduced from the test functions. If TRUE, then: If envelope provides the theoretical value 'theo' for the simulated model, then this value is used. Otherwise, the theoretical function is taken as the mean of the simulations.

save.cons.envelope

Logical flag indicating whether to save the unadjusted envelope test results.

savefuns

Logical flag indicating whether to save all the simulated function values. See envelope.

savepatterns

Logical flag indicating whether to save all the simulated point patterns. See envelope.

verbose

Logical flag indicating whether to print progress reports during the simulations. See envelope.

mc.cores

The number of cores to use, i.e. at most how many child processes will be run simultaneously. Must be at least one, and parallelization requires at least two cores. On a Windows computer mc.cores must be 1 (no parallelization). For details, see mclapply, for which the argument is passed.

Details

The specification of X is important here:

1) If simfun = NULL and fitfun = NULL (default), then envelope is used for generating simulations under the null hypothesis and

2) The user can provide the function for fitting the model (fitfun) and for simulating from the fitted model (simfun). These functions should be coupled with each other such that the object returned by 'fitfun' is directly accepted as the (single) argument in 'simfun'. Further X should then be an ppp object and 'fitfun' should accept as the argument an ppp object (X and further simulated point patterns).

Several test functions are allowed and these are to be estimated for the data and generated point patterns using the function envelope. The test functions are specified through the argument testfuns, which is passed to combined_global_envelope_with_sims.

If test = 'rank', then the test is the combined global rank envelope test. If test = 'qdir', then the test is the combined global directional quantile maximum absolute difference (MAD) envelope test, and if test = 'st', the test is the combined global studentized MAD envelope test, see Mrkvicka et al.

Value

An object of class adjusted_envelope_test.

References

Mrkvicka, T., Myllymäki, M. and Hahn, U. Multiple Monte Carlo testing, with applications in spatial point processes. Revision submitted to Statistics & Computing.

Myllymäki, M., Mrkvička, T., Grabarnik, P., Seijo, H. and Hahn, U. (2015). Global envelope tests for spatial point patterns. arXiv:1307.0239v4 [stat.ME]

Dao, N.A. and Genton, M. (2014). A Monte Carlo adjusted goodness-of-fit test for parametric models describing spatial point patterns. Journal of Graphical and Computational Statistics 23, 497-517.

See Also

rank_envelope, qdir_envelope, st_envelope, plot.adjusted_combined_envelope_test


myllym/spptest documentation built on May 23, 2019, noon