msQuantile: Quantile of the multiscale statistics

Description Usage Arguments Details Value References See Also Examples

View source: R/main.R View source: R/RcppExports.R

Description

Simulate quantiles of the multiscale statistics under the null hypothesis.

Usage

1
msQuantile(n, alpha = c(0.1), nsim = 5000, verbose = TRUE, is.sim = (n < 1e4), ...)

Arguments

n

number of observations

alpha

significance level; the (1-alpha)-quantile of the null distribution of the multiscale statistic via Monte Carlo simulation

nsim

numer of Monte Carlo simulations

is.sim

logical. If TRUE (default if n < 10,000) the quantile is determined via Monte Carlo simulations, which might take a long time; otherwise (default if n >= 10,000) it uses the quantile with n = 10,000, which has been precomputed and stored.

verbose

logical. If TRUE (default) it prints some details about the computation; otherwise nothing is printed.

...

further arguments passed to function quantile.

Details

Empirically, it turns out that the (1-alpha)-quantile of the multiscale statistic converges fast to that of the limit distribution as the number of samples n increases. Thus, for the sake of computational efficiency, the quantile with n = 10,000 are used by default for that with n > 10,000, which has already been precomputed and stored. Of course, for arbitrary sample size n, one can always simulate the quantile by setting is.sim = TRUE, and use the precomputed value by setting is.sim = FALSE. For a given sample size n, simulations are once computed, and then automatically recorded in main memory for later usage.

Value

A vector of length length(alpha) is returned, the same structure as returned by funtion quantile. See Li et al. (2016) for further details.

References

Li, H., Munk, A., Sieling, H., and Walther, G. (2016). The essential histogram. arXiv:1612.07216.

See Also

essHistogram

Examples

1
2
3
4
5
6
7
n    = 100 # number of observations
nsim = 100 # number of simulations

alpha = c(0.1, 0.9) # significance level
q     = msQuantile(n, alpha, nsim)

print(q)

essHist documentation built on April 9, 2018, 5:04 p.m.