Description Usage Arguments Details Value Author(s) See Also Examples
This function returns the scan statistics q-value which is approximated by Monte Carlo simulation.
1 | prob_fun_mc(N,k,m,p,mc_rep)
|
N |
number of Bernoulli trials. |
k |
a number or numeric vector represents scan statistics quantile(s). |
m |
scan statistics window length. |
p |
success probabiliy for each Bernoulli trial under null hypothesis. |
mc_rep |
number of replications. |
It has been proved that calculate excat scan statistics probability
is a NP hard problem. Thus, a straightway to solve this problem is using Monte
Carlo simulation. As mc_rep
getting larger, the result will be closer to
the true value but a longer time it will take to obtain the result.
This is a tradeoff between accuracy and efficiency.
N
, m
, mc_rep
are all integers, where
m > 0, 0 ≤ min(k) ≤ max(k) ≤ m and N/m > 5.
p
is a real number where 0 < p ≤ 1.
This function returns the approximated q-value.
Zhicong Zhao
prob_fun
which approximate q-value by
1-dependent stationary sequences.
1 2 3 4 | ## estimate running time ##
set.seed(100)
system.time({q_value <- prob_fun_mc(1000,4:6,10,0.1,10000)})
q_value
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.