Haiman_window_lth: Minimum Window Length for Scan Statistics

Description Usage Arguments Details Value Author(s) References Examples

View source: R/Haiman_window_lth.R

Description

This function returns the minimum window length that could be used in scan statistics hypothesis test with a given significance level.
Here the q-value is approximated by 1-dependent stationary sequences. This minimum window length also consider the restrictions of input parameters.

Usage

1
Haiman_window_lth(N, p, alpha, lower_wl=3, upper_wl=100)

Arguments

N

number of Bernoulli trials.

p

success probabiliy for each Bernoulli trial under null hypothesis.

alpha

hypothesis test significance level.

lower_wl

lower bound for searching the minimum window length.

upper_wl

upper bound for searching the minimum window length.

Details

This function is searching for the minimum window length with binary search.

Too small window length is invalid because the alpha level of the hypothesis is hard to achieve. On the other hand, too large window length is also not working well. The reason is that with too large window length, the test losts the power. Also, to detect the embedded clusters, considering the edge effects, large window length is hard to have a good performance in general. So, this function has upper searching bound such that window_lth < N/4.

Value

minimum scan statistics window length for using 1-dependent stationary sequences approximation is returned.

Author(s)

Zhicong Zhao

References

Haiman,G.(2007), Estimating the distribution of one-dimensional discrete scan statistics viewed as extremes of 1-dependent stationary sequences. Journal of Statistical Planning and Inference, 137(2007), 821-828.

Examples

1
Haiman_window_lth(1000,0.2,0.05)

zhicongz/AnomDetct documentation built on Dec. 12, 2019, 9:16 a.m.