modeHunting {modehunt}R Documentation

Multiscale analysis of a density on all possible intervals

Description

Simultanous confidence statements for the existence and location of local increases and decreases of a density f, computed on all intervals spanned by two observations.

Usage

modeHunting(X.raw, lower = -Inf, upper = Inf, crit.vals, min.int = FALSE)

Arguments

X.raw

Vector of observations.

lower

Lower support point of ff, if known.

upper

Upper support point of ff, if known.

crit.vals

2-dimensional vector giving the critical values for the desired level.

min.int

If min.int = TRUE, the set of minimal intervals is output, otherwise all intervals with a test statistic above the critical value are given.

Details

In general, the methods modeHunting, modeHuntingApprox, and modeHuntingBlock compute for a given level α(0,1)\alpha \in (0, 1) and the corresponding critical value cjk(α)c_{jk}(\alpha) two sets of intervals

D±(α)={Ijk : ±Tjk(X)>cjk(α)}\mathcal{D}^\pm(\alpha) = \Bigl\{ \mathcal{I}_{jk} \ : \ \pm T_{jk}({\bf{X}} ) > c_{jk}(\alpha) \Bigr\}

where Ijk:=(X(j),X(k))\mathcal{I}_{jk}:=(X_{(j)},X_{(k)}) for 0j<kn+1,kj>10\le j < k \le n+1, k-j> 1 and cjkc_{jk} are appropriate critical values.

Specifically, the function modeHunting computes D±(α)\mathcal{D}^\pm(\alpha) based on the two test statistics

Tn+(X,I)=max(j,k)I(Tjk(X)/σjkΓ(kjn+2))T_n^+({\bf{X}}, \mathcal{I}) = \max_{(j,k) \in \mathcal{I}} \Bigl( |T_{jk}({\bf{X}})| / \sigma_{jk} - \Gamma \Bigl(\frac{k-j}{n+2}\Bigr)\Bigr)

and

Tn(X,I)=max(j,k)I(Tjk(X)/σjk),T_n({\bf{X}}, \mathcal{I}) = \max_{(j,k) \in \mathcal{I}} ( |T_{jk}({\bf{X}})| / \sigma_{jk} ),

using the set I:=Iall\mathcal{I} := \mathcal{I}_{all} of all intervals spanned by two observations (X(j),X(k))(X_{(j)}, X_{(k)}):

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\}.

We introduced the local test statistics

Tjk(X):=i=j+1k1(2X(i;j,k)1)1{X(i;j,k)(0,1)},T_{jk}({\bf{X}}) := \sum_{i=j+1}^{k-1} ( 2 X_{(i; j, k)} - 1) 1\{X_{(i; j, k)} \in (0,1)\},

for local order statistics

X(i;j,k):=X(i)X(j)X(k)X(j),X_{(i; j, k)} := \frac{X_{(i)}-X_{(j)}}{X_{(k)} - X_{(j)}},

the standard deviation σjk:=(kj1)/3\sigma_{jk} := \sqrt{(k-j-1)/3} and the additive correction term Γ(δ):=2log(e/δ)\Gamma(\delta) := \sqrt{2 \log(e / \delta)} for δ>0\delta > 0.

If min.int = TRUE, the set D±(α)\mathcal{D}^\pm(\alpha) is replaced by the set D±(α){\bf{D}}^\pm(\alpha) of its minimal elements. An interval JD±(α)J \in \mathcal{D}^\pm(\alpha) is called minimal if D±(α)\mathcal{D}^\pm(\alpha) contains no proper subset of JJ. This minimization post-processing step typically massively reduces the number of intervals. If we are mainly interested in locating the ranges of increases and decreases of ff as precisely as possible, the intervals in D±(α)D±(α)\mathcal{D}^\pm(\alpha) \setminus \bf{D}^\pm(\alpha) do not contain relevant information.

Value

Dp

The set D+(α)\mathcal{D}^+(\alpha) (or D+(α)\bf{D}^+(\alpha)), based on the test statistic with additive correction Γ\Gamma.

Dm

The set D(α)\mathcal{D}^-(\alpha) (or D(α)\bf{D}^-(\alpha)), based on the test statistic with Γ\Gamma.

Dp.noadd

The set D+(α)\mathcal{D}^+(\alpha) (or D+(α)\bf{D}^+(\alpha)), based on the test statistic without Γ\Gamma.

Dm.noadd

The set D+(α)\mathcal{D}^+(\alpha) (or D(α)\bf{D}^-(\alpha)), based on the test statistic without Γ\Gamma.

Note

Critical values for modeHunting and some combinations of nn and α\alpha are provided in the data set cvModeAll. Critical values for other values of nn and α\alpha can be generated using criticalValuesAll.

Parts of this function were derived from MatLab code provided on Lutz Duembgen's webpage,
http://www.staff.unibe.ch/duembgen.

Author(s)

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

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

References

Duembgen, L. and Walther, G. (2008). Multiscale Inference about a density. Ann. Statist., 36, 1758–1785.

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

See Also

modeHuntingApprox, modeHuntingBlock, and cvModeAll.

Examples

## for examples type
help("mode hunting")
## and check the examples there

[Package modehunt version 1.0.7 Index]