R/flash_methods.R

get_method_defaults <- function(method) {
  nn_param <- list(mixcompdist = "+uniform",
                   optmethod = "mixSQP")
  ash_param <- list(mixcompdist = "normal",
                    optmethod = "mixSQP")

  return(switch(method,
                fastest = list(init_fn = "udv_si",
                               ebnm_fn = "ebnm_pn",
                               ebnm_param = NULL,
                               stopping_rule = "objective",
                               tol = 1e-2,
                               verbose_output = "odn"),
                nonnegative = list(init_fn = "udv_nn",
                                   ebnm_fn = "ebnm_ash",
                                   ebnm_param = list(l = nn_param,
                                                     f = nn_param),
                                   stopping_rule = "objective",
                                   tol = 1e-2,
                                   verbose_output = "odLFn"),
                nnloadings = list(init_fn = "udv_nnloadings",
                                  ebnm_fn = "ebnm_ash",
                                  ebnm_param = list(l = nn_param,
                                                    f = ash_param),
                                  stopping_rule = "loadings",
                                  tol = 1e-3,
                                  verbose_output = "odLn"),
                nnfactors = list(init_fn = "udv_nnloadings",
                                 ebnm_fn = "ebnm_ash",
                                 ebnm_param = list(l = ash_param,
                                                   f = nn_param),
                                 stopping_rule = "factors",
                                 tol = 1e-3,
                                 verbose_output = "odFn"),
                custom = list(init_fn = NULL,
                              ebnm_fn = NULL,
                              ebnm_param = NULL,
                              stopping_rule = NULL,
                              tol = NULL,
                              verbose_output = NULL)))
}
willwerscheid/flashrtools documentation built on May 10, 2019, 8:28 a.m.