Mercurial > forge
diff main/statistics/inst/hmmgenerate.m @ 2689:e8b0cde34d1b octave-forge
Improved texinfo.
author | whyly |
---|---|
date | Sun, 15 Oct 2006 19:50:42 +0000 |
parents | a613a7093388 |
children | 762ed030be30 |
line wrap: on
line diff
--- a/main/statistics/inst/hmmgenerate.m Sun Oct 15 08:55:05 2006 +0000 +++ b/main/statistics/inst/hmmgenerate.m Sun Oct 15 19:50:42 2006 +0000 @@ -19,70 +19,83 @@ ## @deftypefnx {Function File} {} hmmgenerate (@dots{}, 'symbols', @var{symbols}) ## @deftypefnx {Function File} {} hmmgenerate (@dots{}, 'statenames', @var{statenames}) ## Generates an output sequence and hidden states for a Hidden Markov Model. -## The model starts with state @code{1} at step @code{0} but will not -## include step @code{0} in the generated states and sequence +## The model starts in state @code{1} at step @code{0} but will not include +## step @code{0} in the generated states and sequence. ## ## Arguments are ## -## @itemize +## @itemize @bullet ## @item ## @var{len} is the number of steps to generate. @var{sequence} and -## @var{states} will have @var{len} entries each +## @var{states} will have @var{len} entries each. +## ## @item -## @var{transprob} is the matrix with the transition probabilities for the -## states. @code{transprob (i, j)} is the probability for a transition to -## state @code{j} given state @code{i} +## @var{transprob} is the matrix of transition probabilities for the states. +## @code{transprob (i, j)} is the probability for a transition to state +## @code{j} given state @code{i}. +## ## @item -## @var{outprob} is the matrix with the output probabilities. +## @var{outprob} is the matrix of output probabilities. ## @code{outprob (i, j)} is the probability for generating output @code{j} -## given state @code{i} +## given state @code{i}. ## @end itemize ## ## Return values are ## -## @itemize +## @itemize @bullet ## @item -## @var{sequence} is a vector of length @var{len} with the generated +## @var{sequence} is a vector of length @var{len} of the generated ## outputs. The outputs are integers ranging from @code{1} to -## @code{columns (outprob)} +## @code{columns (outprob)}. +## ## @item -## @var{states} is a vector of length @var{len} with the generated hidden +## @var{states} is a vector of length @var{len} of the generated hidden ## states. The states are integers ranging from @code{1} to -## @code{columns (transprob)} +## @code{columns (transprob)}. ## @end itemize ## -## If 'symbols' is specified, then the elements of @var{symbols} are used -## for the output sequence instead of integers ranging from @code{1} to -## @code{columns (outprob)}. @var{symbols} can be a cell array +## If @code{'symbols'} is specified, then the elements of @var{symbols} are +## used for the output sequence instead of integers ranging from @code{1} to +## @code{columns (outprob)}. @var{symbols} can be a cell array. ## -## If 'statenames' is specified, then the elements of @var{statenames} are -## used for the states instead of integers ranging from @code{1} to -## @code{columns (transprob)}. @var{statenames} can be a cell array +## If @code{'statenames'} is specified, then the elements of +## @var{statenames} are used for the states instead of integers ranging from +## @code{1} to @code{columns (transprob)}. @var{statenames} can be a cell +## array. ## ## Examples: ## ## @example +## @group ## transprob = [0.8, 0.2; 0.4, 0.6]; ## outprob = [0.2, 0.4, 0.4; 0.7, 0.2, 0.1]; ## [sequence, states] = hmmgenerate (25, transprob, outprob) +## @end group ## +## @group ## symbols = @{'A', 'B', 'C'@}; ## statenames = @{'One', 'Two'@}; ## [sequence, states] = hmmgenerate (25, transprob, outprob, 'symbols', symbols, 'statenames', statenames) +## @end group ## @end example ## ## References: ## -## @itemize +## @enumerate ## @item -## @cite{Matlab 7.0 documentation (pdf)} +## W. L. Martinez and A. R. Martinez. @cite{Computational Statistics +## Handbook with MATLAB.} Chapman & Hall/CRC, pages 547-557, 2001. +## ## @item -## @uref{http://en.wikipedia.org/wiki/Hidden_Markov_Model} -## @end itemize -## +## Wikipedia contributors. Hidden Markov model. @cite{Wikipedia, The Free +## Encyclopedia.} +## @uref{http://en.wikipedia.org/w/index.php?title=Hidden_Markov_model&oldid=81100294}, +## October 2006. +## @end enumerate ## @end deftypefn ## Author: Arno Onken <whyly@gmx.net> +## Description: Output sequence and hidden states for a Hidden Markov Model function [sequence, states] = hmmgenerate (len, transprob, outprob, varargin)