Learn R Programming

GET (version 0.1-3)

rank_envelope: The rank envelope test

Description

The rank envelope test, p-values and global envelopes. The test corresponds to the global envelope test that can be carriet out by global_envelope_test by specifying the type for which the options "rank", "erl", "cont" and "area" are available. The last three are modifications of the first one to treat the ties in the extreme rank ordering used in "rank". This function is kept for historical reasons.

Usage

rank_envelope(curve_set, type = "rank", ...)

Arguments

curve_set

A curve_set (see create_curve_set) or an envelope object. If an envelope object is given, it must contain the summary functions from the simulated patterns which can be achieved by setting savefuns = TRUE when calling envelope.

type

The type of the global envelope with current options for "rank", "erl", "cont" and "area". If "rank", the global rank envelope accompanied by the p-interval is given (Myllym<U+00E4>ki et al., 2017). If "erl", the global rank envelope based on extreme rank lengths accompanied by the extreme rank length p-value is given (Myllym<U+00E4>ki et al., 2017, Mrkvi<U+010D>ka et al., 2018). See details and additional sections thereafter.

...

Additional parameters to be passed to global_envelope_test.

Value

An object of class "global_envelope" and "fv" (see fv.object), which can be printed and plotted directly. See global_envelope_test for more details.

Number of simulations

The global "erl", "cont", "area" envelope tests allow in principle a lower number of simulations to be used than the global "rank" test based on extreme ranks. However, if feasible, we recommend some thousands of simulations in any case to achieve a good power and repeatability of the test. For the global "rank" envelope test, Myllym<U+00E4>ki et al. (2017) recommended to use at least 2500 simulations for testing at the significance level alpha = 0.05 for single function tests, experimented with summary functions for point processes.

Details

The "rank" envelope test is a completely non-parametric test, which provides the 100(1-alpha)% global envelope for the chosen test function T(r) on the chosen interval of distances and associated p-values. The other three types are solutions to break the ties in the extreme ranks on which the "rank" envelope test is based on.

Note: The method to break ties for the global type = "rank" envelope (Myllym<U+00E4>ki et al., 2017) can be done by the argument ties with default to ties = "erl" corresponding to the extreme rank length breaking of ties. In this case the global envelope corresponds to the extreme rank measure. If instead choosing type to be "erl", "cont" or "area", then the global envelope corresponds to these measures.

References

Myllym<U+00E4>ki, M., Mrkvi<U+010D>ka, T., Grabarnik, P., Seijo, H. and Hahn, U. (2017). Global envelope tests for spatial point patterns. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79: 381<U+2013>404. doi: 10.1111/rssb.12172

Mrkvi<U+010D>ka, T., Myllym<U+00E4>ki, M. and Hahn, U. (2017). Multiple Monte Carlo testing, with applications in spatial point processes. Statistics & Computing 27 (5): 1239-1255. doi: 10.1007/s11222-016-9683-9

Mrkvi<U+010D>ka, T., Myllym<U+00E4>ki, M., Jilek, M. and Hahn, U. (2018). A one-way ANOVA test for functional data with graphical interpretation. arXiv:1612.03608 [stat.ME]

See Also

global_envelope_test

Examples

Run this code
# NOT RUN {
# See ?global_envelope_test for more examples

## Testing complete spatial randomness (CSR)
#-------------------------------------------
if(require("spatstat", quietly=TRUE)) {
  pp <- unmark(spruces)
  
# }
# NOT RUN {
nsim <- 2499 # Number of simulations
# }
# NOT RUN {
  
# }
# NOT RUN {
  # Generate nsim simulations under CSR, calculate L-function for the data and simulations
  env <- envelope(pp, fun="Lest", nsim=nsim, savefuns=TRUE, correction="translate",
                  simulate=expression(runifpoint(ex=pp)))
  # The rank envelope test
  res <- rank_envelope(env)
  # Plot the result.
  # - The central curve is now obtained from env[['theo']], which is the
  # value of the L-function under the null hypothesis (L(r) = r).
  plot(res)
  # or (requires R library ggplot2)
  plot(res, plot_style="ggplot2")

  ## Advanced use:
  # Choose the interval of distances [r_min, r_max] (at the same time create a curve_set from 'env')
  curve_set <- crop_curves(env, r_min=1, r_max=7)
  # For better visualisation, take the L(r)-r function
  curve_set <- residual(curve_set, use_theo=TRUE)
  # Do the rank envelope test
  res <- rank_envelope(curve_set); plot(res, plot_style="ggplot2")
}
# }

Run the code above in your browser using DataLab