continue_lcm_tree: continue from a previous model fit

View source: R/lcm_tree.R

continue_lcm_treeR Documentation

continue from a previous model fit

Description

can definitely ignore this function, and use lcm_tree directly with various settings. So this function is for lazy persons.

Usage

continue_lcm_tree(
  old_mod,
  update_hyper_freq = NULL,
  print_freq = NULL,
  tol = 1e-08,
  tol_hyper = 1e-04,
  max_iter = 5000,
  nrestarts = 1,
  keep_restarts = TRUE,
  parallel = TRUE,
  log_restarts = FALSE,
  log_dir = ".",
  random_init = FALSE,
  allow_continue = FALSE
)

Arguments

old_mod

fitted object from lcm_tree(); lcm_tree class

update_hyper_freq

How frequently to update hyperparameters. Default = every 50 iterations.

print_freq

How often to print out iteration number and current value of epsilon (the difference in objective function value for the two most recent iterations).

tol

Convergence tolerance for the objective function. Default is 1E-8.

tol_hyper

The convergence tolerance for the objective function between subsequent hyperparameter updates. Typically it is a more generous tolerance than tol. Default is 1E-4.

max_iter

Maximum number of iterations of the VI algorithm. Default is 5000. NB: check this number before package submission.

nrestarts

Number of random re-starts of the VI algorithm. The restart that gives the highest value of the objective function will be returned. It is recommended to choose nrestarts > 1; The default is 3.

keep_restarts

If TRUE, the results from all random restarts will be returned. If FALSE, only the restart with the highest objective function is returned. ' Default is TRUE.

parallel

If TRUE, the random restarts will be run in parallel. It is recommended to first set the number of cores using doParallel::registerDoParallel(). Otherwise, the default number of cores specified by the doParallel package will be used. Default is TRUE.

log_restarts

If TRUE, when nrestarts > 1 progress of each random restart will be logged to a text file in log_dir. If FALSE and nrestarts > 1, progress will not be shown. If nrestarts = 1, progress will always be printed to the console. Default is FALSE.

log_dir

Directory for logging progress of random restarts. Default is the working directory.

random_init

If TRUE, some random variability will be added to the initial values. The default is FALSE, unless nrestarts > 1, in which case random_init will be set to TRUE and a warning message will be printed. The amount of variability is determined by random_init_vals.

allow_continue

logical, TRUE to save results so can continue running the VI updates with the last iteration from the old results.

See Also

lcm_tree()

Other lcm_tree functions: lcm_tree()


zhenkewu/lotR documentation built on April 24, 2022, 2:36 a.m.