Checks inputs and outputs of an ebnm-style function. Designed to
troubleshoot custom functions, especially those that are intended for use
in the flashier package (e.g., as argument to the ebnm_fn
parameter in function flash).
Usage
ebnm_check_fn(fn, x, s)
Value
Prints a success message and silently returns 1 if all checks pass.
Otherwise the function errors out.
Arguments
fn
The function to be checked.
x
A test set (vector) of observations.
s
A test set of standard errors. Typically, ebnm-style functions
should be able to accept a vector of standard errors or a scalar if all
standard errors are identical. This is not always the case; for example,
the horseshoe prior family requires homoskedastic standard errors.