Simulate data under the mixture normal prior
Source:R/Simulations_functions.R
simu_IBSS_per_level.Rd
Simulate data under the mixture normal prior
Arguments
- lev_res
numerical corresponds to the resolution of the simulated function (ideally between 3 and 10)
- length_grid
vector numerical corresponds to the length of the grid of sigma for mixture component(cf ash)
- pi0
vector of length lev_res, contain digits between 0 and 1, which corresponds corresponds to the proportion of wavelet coefficients that are exactly 0 at a given level of resolution
- alpha
numeric >0, control smoothness of the curves, should be positive and up 4, in particular, $d_sl ~ pi_0,sl delta_0 + sum_k pi_k N(0, 2^- alpha * s sigma_k^2)$
- prop_decay
numeric >0, control the proportion of non-zero wavelet coefficient per scale, $pi_0,sl = 1- exp(-prop_decay*s)$
Examples
out <- simu_IBSS_per_level(lev_res=9, alpha=1, prop_decay = 0.5)
plot(out$sim_func, type="l", ylab="y")
out$emp_pi0
#> [1] 1.0000000 0.5000000 1.0000000 0.8750000 1.0000000 1.0000000 0.9531250
#> [8] 0.9765625 0.9726562
temp_func <- simu_IBSS_per_level(lev_res=9, alpha=1, prop_decay = 0)
print( temp_func$emp_pi0)
#> [1] 0 0 0 0 0 0 0 0 0