em: Parameter estimation by EM algorithm

Description Usage Arguments Value Functions

View source: R/em.R

Description

Calculates approximate MLE's of all involved parameters, i.e. initial distribution probabilities, transition probabilities and whichever parameters are required for the marginal distribution of the emissions. Not expected to be called by the user directly, instead being called during the initialization of an hmm object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
em(
  obs,
  gamma,
  delta,
  lls,
  param_lls,
  lls_mle,
  epsilon = 1e-05,
  max_iter = 1000,
  ...
)

em.binom(obs, gamma, delta, size, prob, ...)

em.exponential(obs, gamma, delta, rate, ...)

em.normal(obs, gamma, delta, mean, sd, ...)

em.poisson(obs, gamma, delta, lambda, ...)

Arguments

obs

The observed data

gamma

Initial value of transition matrix

delta

Initial value of initial distribution

lls

List of marginal densities

param_lls

List of parameters for marginal densities

lls_mle

List of functions that generate MLE's

epsilon

Threshold to stop algorithm when difference in log-likelihood is less than this

max_iter

Maximum number of iterations before stopping

...

Additional arguments, mainly here to avoid "unused argument"-errors.

Value

A list of log-likelihoods, parameter estimates and number of iterations.

Functions


AdvancedR-2021/hmm documentation built on Dec. 17, 2021, 7:41 a.m.