Skip to contents

Simpler companion to mf_simu_ibss_per_level(): draws all wavelet detail coefficients from a SINGLE shared mixture-of-normals (no per-scale variation). The mixture has one null component (sd = 0) with mass pi0; the remaining mass is split uniformly across length_grid - 1 non-null components whose standard deviations are drawn from a 0-anchored cumsum of chi-squared(1) variates.

Usage

mf_simu_ibss_vanilla(lev_res = 8L, length_grid = 10L, pi0 = 0.85)

Arguments

lev_res

integer >= 2. Resolution: the simulated function lives on a length-2^lev_res grid.

length_grid

integer >= 2. Number of mixture components (including the null at component 1).

pi0

numeric in [0, 1]. Prior probability that any given wavelet detail coefficient is exactly zero. Default 0.85.

Value

A list with components:

sim_func

length-2^lev_res numeric vector, the simulated function in position space.

true_coef

wavelet detail coefficients used to construct sim_func.

true_g

the ashr::normalmix object describing the shared mixture prior.

emp_pi0

empirical proportion of detail coefficients drawn from the null component (the Monte Carlo realization of pi0).

Details

Useful for quick simulation when you don't need per-scale control over the prior. The per-scale variant (mf_simu_ibss_per_level) better mirrors the prior fSuSiE actually infers.

Examples

set.seed(1L)
f <- mf_simu_ibss_vanilla(lev_res = 7L)
length(f$sim_func)
#> [1] 128
f$emp_pi0
#> [1] 0.8740157