flash_ebnm | R Documentation |
flash_ebnm
is a helper function that provides readable syntax for
constructing ebnm
functions that can serve as
arguments to parameter ebnm_fn
in functions flash
,
flash_greedy
, and flash_factors_init
(see
Examples below). It is also possible to write a custom function
from scratch: see Details below for a simple example. A more
involved example can be found in the "Extending ebnm with custom ebnm-style
functions" vignette in the ebnm
package.
flash_ebnm(...)
... |
Parameters to be passed to function |
As input to parameter ebnm_fn
in functions flash
,
flash_greedy
, and flash_factors_init
,
it should suffice for many purposes to
provide functions from package ebnm
as is (for example, one might
set ebnm_fn = ebnm_point_laplace
). To use non-default
arguments, function flash_ebnm
may be used (see Examples).
Custom functions may also be written; for details, see the "Extending
ebnm with custom ebnm-style functions" vignette in the
ebnm
package.
A function that can be passed as argument to parameter
ebnm_fn
in functions flash
,
flash_greedy
, and flash_factors_init
.
ebnm
# 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
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.