seqHMM-deprecated: Deprecated function(s) in the seqHMM package

seqHMM-deprecatedR Documentation

Deprecated function(s) in the seqHMM package

Description

These functions are provided for compatibility with older version of the seqHMM package. They will be eventually completely removed.

Usage

fit_hmm(
  model,
  em_step = TRUE,
  global_step = FALSE,
  local_step = FALSE,
  control_em = list(),
  control_global = list(),
  control_local = list(),
  lb,
  ub,
  threads = 1,
  log_space = FALSE,
  ...
)

fit_mhmm(
  model,
  em_step = TRUE,
  global_step = FALSE,
  local_step = FALSE,
  control_em = list(),
  control_global = list(),
  control_local = list(),
  lb,
  ub,
  threads = 1,
  log_space = FALSE,
  ...
)

trim_hmm(
  model,
  maxit = 0,
  return_loglik = FALSE,
  zerotol = 1e-08,
  verbose = TRUE,
  ...
)

Arguments

model

An object of class hmm or mhmm.

em_step

Logical. Whether or not to use the EM algorithm at the start of the parameter estimation. The default is TRUE.

global_step

Logical. Whether or not to use global optimization via nloptr (possibly after the EM step). The default is FALSE.

local_step

Logical. Whether or not to use local optimization via nloptr (possibly after the EM and/or global steps). The default is FALSE.

control_em

Optional list of control parameters for the EM algorithm. Possible arguments are

maxeval

The maximum number of iterations, the default is 1000. Note that iteration counter starts with -1 so with maxeval=1 you get already two iterations. This is for backward compatibility reasons.

print_level

The level of printing. Possible values are 0 (prints nothing), 1 (prints information at the start and the end of the algorithm), 2 (prints at every iteration), and for mixture models 3 (print also during optimization of coefficients).

reltol

Relative tolerance for convergence defined as (logLik_new - logLik_old)/(abs(logLik_old) + 0.1). The default is 1e-10.

restart

A list containing options for possible EM restarts with the following components:

times

Number of restarts of the EM algorithm using random initial values. The default is 0, i.e. no restarts.

transition

Logical. Should the original transition probabilities be varied? The default is TRUE.

emission

Logical. Should the original emission probabilities be varied? The default is TRUE.

sd

Standard deviation for rnorm used in randomization. The default is 0.25.

maxeval

Maximum number of iterations, the default is control_em$maxeval

print_level

Level of printing in restarted EM steps. The default is control_em$print_level.

reltol

Relative tolerance for convergence at restarted EM steps. The default is control_em$reltol. If the relative change of the final model of the restart phase is larger than the tolerance for the original EM phase, the final model is re-estimated with the original reltol and maxeval at the end of the EM step.

n_optimum

Save the log-likelihood values of the n_optimum best models (from all estimated models including the the first EM run.). The default is min(times + 1, 25).

use_original

If TRUE. Use the initial values of the input model as starting points for the permutations. Otherwise permute the results of the first EM run.

control_global

Optional list of additional arguments for nloptr argument opts. The default values are

algorithm

"NLOPT_GD_MLSL_LDS"

local_opts

list(algorithm = "NLOPT_LD_LBFGS", ftol_rel = 1e-6, xtol_rel = 1e-4)

maxeval

10000 (maximum number of iterations in global optimization algorithm.)

maxtime

60 (maximum time for global optimization. Set to 0 for unlimited time.)

control_local

Optional list of additional arguments for nloptr argument opts. The default values are

algorithm

"NLOPT_LD_LBFGS"

ftol_rel

1e-10

xtol_rel

1e-8

maxeval

10000 (maximum number of iterations)

lb, ub

Lower and upper bounds for parameters in Softmax parameterization. The default interval is [pmin(-25, 2*initialvalues), pmax(25, 2*initialvalues)], except for gamma coefficients, where the scale of covariates is taken into account. Note that it might still be a good idea to scale covariates around unit scale. Bounds are used only in the global optimization step.

threads

Number of threads to use in parallel computing. The default is 1.

log_space

Make computations using log-space instead of scaling for greater numerical stability at a cost of decreased computational performance. The default is FALSE.

...

Additional arguments to nloptr.

maxit

Number of iterations. After zeroing small values, the model is refitted, and this is repeated until there is nothing to trim or maxit iterations are done.

return_loglik

Return the log-likelihood of the trimmed model together with the model object. The default is FALSE.

zerotol

Values smaller than this are trimmed to zero.

verbose

Print results of trimming. The default is TRUE.


helske/seqHMM documentation built on July 6, 2023, 6:45 a.m.