Learn R Programming

fHMM (version 1.4.2)

get_initial_values: Initialization of numerical likelihood optimization

Description

This helper function generates a set of initial values for the numerical optimization of the model likelihood function.

Usage

get_initial_values(
  data,
  ncluster = 1,
  seed = NULL,
  verbose = TRUE,
  initial_estimate = NULL
)

Value

A list, where each element is an object of class parUncon.

Arguments

data

An object of class fHMM_data.

ncluster

Set the number of clusters for parallel optimization runs to reduce optimization time. By default, ncluster = 1 (no clustering).

seed

Set a seed for the generation of initial values. No seed by default.

verbose

Set to TRUE to print progress messages.

initial_estimate

Optionally defines an initial estimate for the numerical likelihood optimization. Good initial estimates can improve the optimization process. Can be:

  • NULL (the default), in this case

    • applies a heuristic to calculate a good initial estimate

    • or uses the true parameter values (if available and data$controls$origin is TRUE)

  • or an object of class parUncon (i.e., a numeric of unconstrained model parameters), for example the estimate of a previously fitted model (i.e. the element model$estimate).