blocks {modehunt}R Documentation

Computes number of observations for each block

Description

In Rufibach and Walther (2010) a new multiscale mode hunting procedure is presented that compares the local test statistics with critical values given by blocks. Blocks are collection of intervals on a given grid that contain roughly the same number of original observations.

Usage

blocks(n, m0 = 10, fm = 2)

Arguments

n

Number of observations.

m0

Initial parameter that determines the number of observations in one block.

fm

Factor by which mm is increased from block to block.

Details

In our block procedure, we only consider a subset Iapp\mathcal{I}_{app} of all possible intervals Iall\mathcal{I}_{all} where

Iall={(j, k) : 0j<kn+1, kj>1}.\mathcal{I}_{all} = \Bigl\{(j, \ k ) \ : \ 0 \le j < k \le n+1, \ k - j > 1\Bigr\}.

This subset Iapp\mathcal{I}_{app} is computed as follows:

Set d1,m1,fm>1d_1, m_1, f_m > 1. Then:

for  r=1,,#blocksfor \ \ r = 1,\ldots,\#blocks

dr:=round(d1fm(r1)/2), mr:=m1fmr1.d_r := round(d_1 f_m^{(r-1)/2}), \ m_r := m_1 f_m^{r-1}.

Include (j,k)(j,k) in Iapp\mathcal{I}_{app} if

(a) j,k{1+idr, i=0,1,}j, k \in \{1+i d_r, \ i = 0, 1, \dots \} \ \ (we only consider every dd–th observation) and

(b) mrkj12mr1m_r \le k-j-1 \le 2m_r-1 \ \ (Ijk\mathcal{I}_{jk} contains between mrm_r and 2mr12m_r - 1 observations)

end  forend \ \ for

Value

b×2b \times 2–matrix, where bb is the number of blocks and the columns contain the lower and the upper number of observations that form each block.

Note

The asymptotic results in Rufibach and Walther (2010) are only derived for fm=2f_m = 2.

Author(s)

Kaspar Rufibach, kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch

Guenther Walther, gwalther@stanford.edu,
www-stat.stanford.edu/~gwalther

References

Rufibach, K. and Walther, G. (2010). A general criterion for multiscale inference. J. Comput. Graph. Statist., 19, 175–190.

See Also

This function is called by modeHuntingBlock.


[Package modehunt version 1.0.7 Index]