View source: R/tree-simulation-functions.R
gen.mu.leaves | R Documentation |
Generate the signal in the leaves of the tree
gen.mu.leaves(m, K1, d, grouped, setting, barmu, leaf_list)
m |
An integer value, the number of hypotheses |
K1 |
An integer value, the number of non-null leaves |
d |
A numeric value in |
grouped |
A boolean value, whether the non-null leaves are contiguous or not |
setting |
A character value specifying the shape of the signal in each non-null leaf |
barmu |
A numeric value, the strength of the signal |
leaf_list |
A list of leaves as generated by |
If setting == "const"
the non-null signal is constant equal to barmu
. If setting == "gauss"
and d=1
the signal in an active leaf has the shape of a Gaussian bell with mean barmu
, see the gauss_bloc
function which generates it. If d<1
it has the same shape but randomly pruned. If setting == "poisson"
the non-null signal is randomly drawn according to a Poisson distribution of mean barmu
(slightly modified to not yield 0). If setting == "rgauss"
the non-null signal is randomly drawn according to a Normal distribution of mean barmu
and variance barmu
.
A numeric vector of length m
, the signal values for each hypothesis
gauss_bloc
m <- 160
s <- 10
K1 <- floor(m/(s * 4))
d <- 1
barmu <- 4
dd <- dyadic.from.window.size(m, s, method = 2)
leaf_list <- dd$leaf_list
muC <- gen.mu.leaves(m = m, K1 = K1, d = d, grouped = FALSE,
setting = "const", barmu = barmu, leaf_list =leaf_list)
muC <- gen.mu.leaves(m = m, K1 = K1, d = d, grouped = TRUE,
setting = "const", barmu = barmu, leaf_list =leaf_list)
muG <- gen.mu.leaves(m = m, K1 = K1, d = d, grouped = FALSE,
setting = "gauss", barmu = barmu, leaf_list =leaf_list)
muP <- gen.mu.leaves(m = m, K1 = K1, d = d, grouped = FALSE,
setting = "poisson", barmu = barmu, leaf_list =leaf_list)
mu <- cbind(constant = muC, Gaussian = muG, Poisson = muP)
matplot(mu, t = 's')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.