Search This Blog

Saturday, June 01, 2013

An example of EM for HMM, MLE for HMM and backward, forward algorithms for HMM

# This document contains four main files: 
  # function 'rdata.hmm' (rdata1.hmm) is the HMM data generator
  # function 'bwfw.hmm' (bwfw1.hmm) realizes the forward-backward procedure
  # function 'em.hmm' (em1.hmm) realizes the E-M algorithm
  # function 'mt.hmm' realizes the new multiple testing procedures 
    # (given the estimates of HMM parameters)

# Examples on how to use these functions are given below. 

# R codes for other multiple testing procedures are also included for the comprehensive Example 5:
  # function 'mt.bh' realizes the BH step-up procedure 
  # function 'mt.gw' realizes the adaptive p-value procedure

# More detailed instructions are given in each separate file. 

###############################
######   EXAMPLES   ###########
###############################

source("rdata1.hmm.R.txt")
source("rdata.hmm.R.txt")
source("bwfw1.hmm.R.txt")
source("bwfw.hmm.R.txt")
source("em1.hmm.R.txt")
source("em.hmm.R.txt")
source("mt.hmm.R.txt")
source("mt.gw.R.txt")
source("mt.bh.R.txt")

 # the number of observations
NUM1<-1000 0.05="" 0.2="" 0.3="" 0.80="" 0="" 1:="" 1:hiv.num="" 1="" 2:="" 2="" 3:="" 3="" 4:="" 5:="" a0.hiv="" a0="" a="" algorithm="" alternative="" analysis="" and="" ap="" b="" backward.var="" backward="" bh="" bw="" bwfw.hmm="" bwfw1.hmm="" byrow="TRUE)" c="" data="" de="" decision="" distribution="" e-m="" em.hmm="" em.res1="" em.res2="" em1.hmm="" em="" estimates="" example="" f0="" f1.v="" f1="" fb.res1="" fb.res2="" fdr="" for="" forward-backward="" forward.var="" fw="" generator="" gw.de="" gw.res="" hiv.ap="" hiv.bh="" hiv.lsi="" hiv.num="" hiv.pi="" hiv.pv="" hiv.res="" hiv="" hivdata.txt="" hmm="" hypotheses="" in="" indices="" initial="" interations="" j="" l="2," length="" level="" lf="" lsi.or="" lsi.pi="" lsi.var="" lsi="" matrix="" maxiter="500)" min="" mixture="" mt.bh="" mt.gw="" mt.hmm="" n1="" non-nulls="" normal="" nr="" null="" num="" number="" o="" observed="" of="" one-component="" or.de="" or.res="" or="" p-value="" p-values="" p0.hiv="" p0="" parameters="" pc="" pi.de="" pi.res="" pi="" pii="" pnorm="" pre="" prespecified="" procedure="" procedures="" proportion="" pv1="" q="" rdata.hmm="" rdata1="" rdata2="" re="" rejected="" rejections="" rule="" s="" scan="" set.seed="" state="" states="" th="" the="" theta1="" three-component="" threshold="" transition="" unobserved="" values="" variable="" x1="" x2="">
 
 
 
 
 
 Available at http://www-stat.wharton.upenn.edu/~tcai/paper/Softwares/FDR-HMM-R-Code/readme.txt 
 

No comments:

Post a Comment

Thank you