EMRaff: Runs EM Algorithm for Rafferty Method

Description Usage Arguments Value

View source: R/EM.R

Description

Runs EM using adapted forward-backward that calculates partially observed data for Rafferty method. Calculates probability of being a stayer, intiial vector, transition matrix, and classification matrix Uses the following functions: ForwardLinearRaff, BackwardLinearRaff, CalcLikelihoodMover, CalcLikelihoodStayer, CalcInitialLinRaff, CalcTransitionLin,Raff CalcClassificationLinRaff, and CalcStayerLin

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
EMRaff(
  data_pattern,
  freq_vec,
  epsilon,
  time_length,
  init,
  tran,
  class,
  pi_0,
  lambda,
  max2,
  max3
)

Arguments

freq_vec

frequency vector of patterns

epsilon

threshold for EM convergence, stops when likelihood percentage increase is below epsilon

time_length

Number of observations per individual

init

initial probabilities

tran

transition probabilities

class

classification probabilities

pi_0

probability of being stayer

lambda

vector of length two, first value is weight given to value at time t-1, second value is weight given to value at time t-2

max2

number of values the second test can take on

max3

number of values the third test can take on

data_array

data array of three combined tests, patternized

Value

list of initial parameters, estimated parameters and likelihood initial and estimated parameter entries have same format 1) initial 2) transition 3) classification 4) stayer probability


jordanaron22/PartiallyObservedHMM documentation built on May 21, 2020, 6:49 p.m.