Description Usage Arguments Details Author(s) References Examples
Test if an observed curve matches a sample of simulated curves (or a group of other observations). A global envelope test is performed, with p-value corresponding to the most extreme pointwise percentile the observed curve reaches among all curves.
1 2 | rankEnv.test(obs, sim, alternative = c("two.sided", "less", "greater"),
inclprob = 0.95, includeobs = TRUE)
|
obs |
object of class |
sim |
object of class |
alternative |
a character string specifying the alternative hypothesis, one of
|
inclprob |
a numerical vector of inclusion probabilities
of the envelopes to be plotted, for use in |
includeobs |
logical, if TRUE, observed curve is also used in the envelope |
The observed curve, represented by the fdsample object
obs is compared to simulated curves collected
in the fdsample object 'sim.
The two sets of curves have to share the same argument values, and obs is
supposed to contain only one curve.
alternative == "less"
is the one-sided alternative meaning that the observed curve
has (some) smaller function values than the simulated curves, and
alternative == "greater" is the opposite one-sided alternative.
The test corresponds to the rank envelope test by Myllymaki et. al (2013, 2015), and to the procedure described in Davison and Hinkley (1997), Equation (4.17). The p-value is obtained by ranking the curves according to the minimum pointwise rank obtained in any point of the curve – note that the curves are actually represented as vectors.
The result of the test can be plotted, see plot.envtest.
Ute Hahn, ute@imf.au.dk
M. Myllymaki, T. Mrkvicka, H. Seijo and P. Grabarnik (2013) Global envelope tests for spatial processes, http://arxiv.org/abs/1307.0239v2.
M. Myllymaki, T. Mrkvicka, P. Grabarnik, H. Seijo and Ute Hahn (2015) Global envelope tests for spatial processes, http://arxiv.org/abs/1307.0239v3.
Davison, A.C. and Hinkley, D.V. (1997) Bootstrap Methods and their Applications, Cambridge University Press, Cambridge.
1 2 3 4 5 6 7 8 9 10 | # make a sample of sinus curves
tt <- seq(0, 2*pi, length = 20)
sinsim <- replicate(5000, sin(tt) + cumsum(rnorm(20, 0, 0.01)))
sinobs <- sin(tt - pi/50) + cumsum(rnorm(20, 0, 0.01))
sim <- fdsample(tt, sinsim)
obs <- fdsample(tt, sinobs)
testresult <- rankEnv.test(obs, sim)
print(testresult)
plot(testresult)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.