R/Simulations_functions.R
simu_IBSS_per_level.Rd
Simulate data under the mixture normal prior
simu_IBSS_per_level(
lev_res = 7,
length_grid = 10,
pi0,
alpha = 0.8,
prop_decay = 0.1
)
numerical corresponds to the resolution of the simulated function (ideally between 3 and 10)
vector numerical corresponds to the length of the grid of sigma for mixture component(cf ash)
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
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)$
numeric >0, control the proportion of non-zero wavelet coefficient per scale, $pi_0,sl = 1- exp(-prop_decay*s)$
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] 0.0000000 1.0000000 1.0000000 0.8750000 0.8125000 0.9375000 0.9843750
#> [8] 0.9921875 0.9804688
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