Produce a set of regions with forest structure, with a single tree, which is dyadic.
Usage
dyadic.from.leaf_list(leaf_list, method)
dyadic.from.window.size(m, s, method)
dyadic.from.height(m, H = NULL, method)
Arguments
- leaf_list
A list of vectors representing the atoms of the forest structure. See
V.star()
for more information.- method
A numeric value. If
method == 1
, start from the leaves and group nodes of a same height 2 by 2 as long as possible. Ifmethod==2
, start from the root and divide nodes in 2 nodes of equal size as long as possible- m
An integer value, the number of hypotheses to have in the structure
- s
An integer value, the number of elements in each atom/leaf
- H
An integer value, the desired maximal height of the tree. If NULL (by default), use
floor(2 + log2(m - 1))
which gives the maximum achievable height givenm
.
Details
dyadic.from.leaf_list
Dyadic tree structure from a given list of atoms/leafs
dyadic.from.window.size
Dyadic tree structure from window size: the number of elements in each atom/leaf is set to
s
dyadic.from.height
Dyadic tree structure from height: the total height of the tree is set to
H
References
Durand, G., Blanchard, G., Neuvial, P., & Roquain, E. (2020). Post hoc false positive control for structured hypotheses. Scandinavian Journal of Statistics, 47(4), 1114-1148.
Examples
m <- 6
dd <- dyadic.from.window.size(m, s = 2, method = 2)
str(dd)
#> List of 2
#> $ leaf_list:List of 3
#> ..$ : num [1:2] 1 2
#> ..$ : num [1:2] 3 4
#> ..$ : num [1:2] 5 6
#> $ C :List of 3
#> ..$ :List of 1
#> .. ..$ : num [1:2] 1 3
#> ..$ :List of 2
#> .. ..$ : num [1:2] 1 2
#> .. ..$ : num [1:2] 3 3
#> ..$ :List of 3
#> .. ..$ : num [1:2] 1 1
#> .. ..$ : num [1:2] 2 2
#> .. ..$ : num [1:2] 3 3
dd <- dyadic.from.height(m, H = 3, method = 2)
str(dd)
#> List of 2
#> $ leaf_list:List of 4
#> ..$ : num [1:2] 1 2
#> ..$ : num [1:2] 3 4
#> ..$ : num 5
#> ..$ : num 6
#> $ C :List of 3
#> ..$ :List of 1
#> .. ..$ : num [1:2] 1 4
#> ..$ :List of 2
#> .. ..$ : num [1:2] 1 2
#> .. ..$ : num [1:2] 3 4
#> ..$ :List of 4
#> .. ..$ : num [1:2] 1 1
#> .. ..$ : num [1:2] 2 2
#> .. ..$ : num [1:2] 3 3
#> .. ..$ : num [1:2] 4 4
dd <- dyadic.from.height(m, method = 2)
str(dd)
#> List of 2
#> $ leaf_list:List of 6
#> ..$ : int 1
#> ..$ : int 2
#> ..$ : int 3
#> ..$ : int 4
#> ..$ : int 5
#> ..$ : int 6
#> $ C :List of 4
#> ..$ :List of 1
#> .. ..$ : num [1:2] 1 6
#> ..$ :List of 2
#> .. ..$ : num [1:2] 1 3
#> .. ..$ : num [1:2] 4 6
#> ..$ :List of 4
#> .. ..$ : num [1:2] 1 2
#> .. ..$ : num [1:2] 3 3
#> .. ..$ : num [1:2] 4 5
#> .. ..$ : num [1:2] 6 6
#> ..$ :List of 6
#> .. ..$ : num [1:2] 1 1
#> .. ..$ : num [1:2] 2 2
#> .. ..$ : num [1:2] 3 3
#> .. ..$ : num [1:2] 4 4
#> .. ..$ : num [1:2] 5 5
#> .. ..$ : num [1:2] 6 6
leaf_list <- dd$leaf_list
dd <- dyadic.from.leaf_list(leaf_list, method = 2)
str(dd)
#> List of 2
#> $ leaf_list:List of 6
#> ..$ : int 1
#> ..$ : int 2
#> ..$ : int 3
#> ..$ : int 4
#> ..$ : int 5
#> ..$ : int 6
#> $ C :List of 4
#> ..$ :List of 1
#> .. ..$ : num [1:2] 1 6
#> ..$ :List of 2
#> .. ..$ : num [1:2] 1 3
#> .. ..$ : num [1:2] 4 6
#> ..$ :List of 4
#> .. ..$ : num [1:2] 1 2
#> .. ..$ : num [1:2] 3 3
#> .. ..$ : num [1:2] 4 5
#> .. ..$ : num [1:2] 6 6
#> ..$ :List of 6
#> .. ..$ : num [1:2] 1 1
#> .. ..$ : num [1:2] 2 2
#> .. ..$ : num [1:2] 3 3
#> .. ..$ : num [1:2] 4 4
#> .. ..$ : num [1:2] 5 5
#> .. ..$ : num [1:2] 6 6