# A custom EBNM function might be written as follows:
my_ebnm_fn <- function(x, s, g_init, fix_g, output) {
ebnm_res <- ebnm_point_laplace(
x = x,
s = s,
g_init = g_init,
fix_g = fix_g,
output = output,
control = list(iterlim = 10)
)
return(ebnm_res)
}
# The following are equivalent:
fl1 <- flash(
gtex,
ebnm_fn = my_ebnm_fn,
greedy_Kmax = 2
)
fl2 <- flash(
gtex,
ebnm_fn = flash_ebnm(
prior_family = "point_laplace",
control = list(iterlim = 10)
),
greedy_Kmax = 2
)
Run the code above in your browser using DataLab