Debian Codegraph @

dwtools/manual_HMM.cpp

raw
1 /* manual_HMM.cpp
2 *
3 * Copyright (C) 2011-2019,2023,2025 David Weenink
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /*
20 djmw 20101009 Initial version
21 */
22
23 #include "ManPagesM.h"
24
25 void manual_HMM (ManPages me);
26 void manual_HMM (ManPages me)
27 {
28
29 MAN_BEGIN (U"expectation-maximization", U"djmw", 20111130)
30 NORMAL (U"Expectation-maximization (EM) is an iterative method used to find maximum "
31 "likelihood estimates of parameters in probabilistic models, where the model depends on "
32 "unobserved, also called %%latent%, variables. EM alternates between performing an expectation (E) step, "
33 "which computes an expectation of the likelihood by including the latent variables as if they "
34 "were observed, and a maximization (M) step, which computes the maximum likelihood "
35 "estimates of the parameters by maximizing the expected likelihood found in the E step. The "
36 "parameters found on the M step are then used to start another E step, and the process is "
37 "repeated until some criterion is satisfied. EM is frequently used for data clustering like for example in "
38 "@@TableOfReal: To GaussianMixture...|Gaussian mixtures@ or in the "
39 "@@HMM & HMMObservationSequences: Learn...|Baum-Welch training@ of a Hidden Markov Model.")
40 MAN_END
41
42 MAN_BEGIN (U"GaussianMixture", U"djmw", 20230718)
43 INTRO (U"A Gaussian mixture is a probability density function (p.d.f.). It is a combination of several Gaussian densities.")
44 NORMAL (U"The GaussianMixture’s p.d.f. is defined as the weighted sum of %K multivariate Gaussian p.d.f.s:")
45 EQUATION (U"pdf(#x) = \\Si__%i=1_^%K %p_%i %N(#x; #\\mu_%i, #\\Si_%i)")
46 NORMAL (U"where each %N(#x; #\\mu_%i, #\\Si_%i) is a multivariate p.d.f. with mean vector #\\mu_%i and covariance matrix #\\Si_%i. "
47 "The coefficients %p_%i sum to 1.")
48 NORMAL (U"For an introduction to Gaussian mixtures see for example @@Bishop (2006)@.")
49 MAN_END
50
51 MAN_BEGIN (U"GaussianMixture: Draw concentration ellipses...", U"djmw", 20101101)
52 INTRO (U"Draws the concentration ellipse for each component in the @@GaussianMixture@.")
53 NORMAL (U"The principal component plane will be determined from @@GaussianMixture: To PCA@.")
54 NORMAL (U"You might also use another @PCA and to combine it with a GaussianMixture for drawing (@@GaussianMixture & PCA: Draw concentration ellipses...@).")
55 ENTRY (U"Settings")
56 TERM (U"##Number of sigmas")
57 DEFINITION (U"determines the @@concentration ellipse|data coverage@.")
58 TERM (U"##Principal component plane")
59 DEFINITION (U"determines whether the principal component plane is used or not for drawing.")
60 MAN_END
61
62 MAN_BEGIN (U"GaussianMixture: Get probability at position", U"djmw",20101103)
63 INTRO (U"Evaluate the pdf of the @@GaussianMixture@ at the given position.")
64 MAN_END
65
66 MAN_BEGIN (U"GaussianMixture & PCA: Draw concentration ellipses...", U"djmw", 20101101)
67 INTRO (U"Draws the concentration ellipse for each component in the @@GaussianMixture@ in the plane spanned by the selected @PCA.")
68 ENTRY (U"Settings")
69 TERM (U"##Number of sigmas")
70 DEFINITION (U"determines the @@concentration ellipse|data coverage@.")
71 MAN_END
72
73 MAN_BEGIN (U"GaussianMixture: Draw marginal pdf...", U"djmw", 20101122)
74 INTRO (U"A command to draw the marginal p.d.f. (probability density function) of the selected @GaussianMixture.")
75 NORMAL (U"A marginal distribution is the projection of the (multivariate) p.d.f. on one dimension or direction. "
76 "This direction may also be externally defined by selecting a @PCA and a GaussianMixture together.")
77 MAN_END
78
79 MAN_BEGIN (U"GaussianMixture: Split component...", U"djmw", 20230801)
80 INTRO (U"Splits one component of the selected @GaussianMixture into two components.")
81 NORMAL (U"The selected component is split on the basis of a @PCA analysis of its covariance matrix. The new means are situated "
82 "around the old components mean, 1%\\si apart in the first principal components direction, and the new covariances are "
83 "constructed with information from the old covariance matrix. ")
84 NORMAL (U"The details of the algorithm are described in @@Zhang et al. (2003)@.")
85 MAN_END
86
87 MAN_BEGIN (U"GaussianMixture: To PCA", U"djmw", 20101030)
88 INTRO (U"Creates a @PCA from the selected @GaussianMixture.")
89 NORMAL (U"The PCA is calculated from the @@GaussianMixture: To Covariance (total)|total covariance matrix@ of the GaussianMixture.")
90 MAN_END
91
92 MAN_BEGIN (U"GaussianMixture & PCA: To Matrix (density)...", U"djmw", 20101101)
93 INTRO (U"Represent the @@GaussianMixture@ p.d.f. on the plane spanned by @@PCA@. This makes it possible to draw "
94 "the p.d.f. as grey values with one of the special @@Matrix@ image drawing methods.")
95 NORMAL (U"For each cell in the matrix of dimension %%numberOfRows% \\xx %%numberOfColumns%, the p.d.f. will be evaluated.")
96 MAN_END
97
98 MAN_BEGIN (U"GaussianMixture: To Covariance (between)", U"djmw", 20101030)
99 INTRO (U"The covariance between the centers of the components of the @@GaussianMixture@ is calculated; "
100 "each center is weighted according to its mixing probability.")
101 MAN_END
102
103 MAN_BEGIN (U"GaussianMixture: To Covariance (within)", U"djmw", 20101120)
104 INTRO (U"The covariances of the components of the @@GaussianMixture@ are pooled.")
105 MAN_END
106
107 MAN_BEGIN (U"GaussianMixture: To Covariance (total)", U"djmw", 20101030)
108 INTRO (U"The sum of the @@GaussianMixture: To Covariance (within)|within@ and @@GaussianMixture: To Covariance (between)|between@ covariances of the @@GaussianMixture@ is calculated.")
109 MAN_END
110
111 MAN_BEGIN (U"GaussianMixture: To TableOfReal (random sampling)...", U"djmw", 20101030)
112 INTRO (U"The selected @@GaussianMixture@ is used as a generator of data.")
113 ENTRY (U"Setting")
114 TERM (U"##Number of data points")
115 DEFINITION (U"determines how many random data point have to be generated.")
116 ENTRY (U"Algorithm")
117 NORMAL (U"For each data point to be generated:")
118 NORMAL (U"1. A random number decides to which component in the mixture the data point will belong.")
119 NORMAL (U"2. According to the procedure described in @@Covariance: To TableOfReal (random sampling)...@, one "
120 "data point will be generated.")
121 MAN_END
122
123 MAN_BEGIN (U"TableOfReal: To GaussianMixture...", U"djmw", 20150930)
124 INTRO (U"Creates a @@GaussianMixture@ from the selected @@TableOfReal@ by an @@expectation-maximization|"
125 "expectation-maximization@ procedure.")
126 ENTRY (U"Settings")
127 TERM (U"##Number of components")
128 DEFINITION (U"defines the number of Gaussians in the mixture.")
129 TERM (U"##Tolerance of minimizer")
130 DEFINITION (U"defines when to stop optimizing. If the relative difference between the likelihoods at two successive "
131 "iteration steps differs by less then the tolerance we stop, i.e. when |(%L(%i-1)-%L(%i))/%L(%i)| < %tolerance.")
132 TERM (U"##Maximum number of iterations")
133 DEFINITION (U"defines another stopping criterion. The EM iteration will stop when either the tolerance "
134 "is reached or the maximum number of iterations. If zero is chosen, no iteration will be performed and the "
135 "GaussianMixture will be initialized with the initial guess.")
136 TERM (U"##Stability coefficient lambda")
137 DEFINITION (U"defines the fraction of the total covariance that will be added to the each of the mixture "
138 "covariance matrices during the EM iteration. This may prevent one or more of these matrices to become singular.")
139 TERM (U"##Covariance matrices are")
140 DEFINITION (U"defines whether the complete covariance matrices in the mixture have to be calculated or only the diagonal.")
141 TERM (U"##Criterion based on")
142 DEFINITION (U"defines how the @@GaussianMixture & TableOfReal: Get likelihood value...|likelihood of the data given the model is calculated@.")
143 ENTRY (U"Expectation\\--Maximization Algorithm")
144 NORMAL (U"The Expectation\\--Maximization (EM) algorithm is an iterative procedure to maximize the likelihood of the data given a model. For a "
145 "GaussianMixture, the parameters in the model are the centers and the covariances of all components in the mixture "
146 "and their mixing probabilities.")
147 NORMAL (U"The number of parameters depends on the number of components in the mixture and the dimension of the data. "
148 "For a full covariance matrix we have to find %dimension%(%dimension%+1)/2 matrix elements and another "
149 "%dimension vector elements for its center. This makes the total number of parameters that have to be estimated "
150 "for a mixture with ##Number of components# components equal to "
151 "%numberOfComponents \\.c %dimension%(%dimension%+3)/2 + %numberOfComponents.")
152 NORMAL (U"For diagonal covariance matrices the number of parameters reduces considerably.")
153 NORMAL (U"The EM iteration has to start with a sensible initial guess for all the parameters. For the initial guess, "
154 "we derive our centers from positions on the 1-\\si ellipse in the plane spanned by the first two principal "
155 "components. We then make all covariance matrices equal to a scaled-down version of the total covariance matrix, "
156 "where the scaling factor depends on the number of components and the quotient of the between and within variance. "
157 "Initially all mixing probabilities will be chosen equal.")
158 NORMAL (U"How to proceed from the initial guess with the EM to find the optimal values for all the parameters "
159 "in the Gaussian mixture is explained in great detail by @@Bishop (2006)@.")
160 MAN_END
161
162 MAN_BEGIN (U"GaussianMixture & TableOfReal: Get likelihood value...", U"djmw", 20190711)
163 INTRO (U"Calculates how well the @GaussianMixture model fits the data according to a criterion.")
164 ENTRY (U"Settings")
165 TERM (U"##Maximum likelihood")
166 EQUATION (U"ML = \\Si__%i=1..%n_ log (\\Si__%m=1..%k_ \\al__%k_ %p__%%ik%_)")
167 TERM (U"##Minimum message length")
168 EQUATION (U"DL = ML - 0.5(N\\.c\\Si__%m=1..%k_ log(%n\\al__%m_/12) -%k\\.clog(%n/12) -%k(%N+1))")
169 TERM (U"##Bayes information")
170 EQUATION (U"BIC = 2\\.cML - k\\.cN\\.clog(n)")
171 TERM (U"##Akaike information")
172 EQUATION (U"AIC = 2(ML - k\\.cN) ")
173 TERM (U"##Akaike corrected")
174 EQUATION (U"AICc = 2(ML - k\\.cN\\.cn/(n-k\\.cN-1))")
175 TERM (U"##Complete-data ML")
176 EQUATION (U"\\Si__%i=1..%n_\\Si__%m=1..%k_ \\ga__%%im%_ log (\\ga__%%im%_)")
177 NORMAL (U"In these formulas, %n is the number of data points, %k is the number of mixture components, %N is the "
178 "number of parameters in one component (i.e. %d + %d(%d+1)/2 for a full covariance matrix of "
179 "dimension %d with means), \\al__%k_ are the %%mixing probabilities%, "
180 "and %p__%%ik%_ are the %%multinormal probabilities% for the %i-th data vector in the %k-th component. "
181 "The %%responsibilities% \\ga__%%im%_ are defined as ")
182 EQUATION (U"\\ga__%%im%_= \\al__%m_\\.c%p__%%im%_ /(\\Si__%j=1..%k_ \\al__%j_\\.c%p__%%ij%_).")
183 MAN_END
184
185 MAN_BEGIN (U"GaussianMixture & TableOfReal: Improve likelihood...", U"djmw", 20230801)
186 INTRO (U"Try to improve the likelihood of the parameters in the @@GaussianMixture@ by an @@expectation-maximization@ algorithm.")
187 ENTRY (U"Settings & EM Algorithm")
188 NORMAL (U"As described in @@TableOfReal: To GaussianMixture...@.")
189 MAN_END
190
191 MAN_BEGIN (U"GaussianMixture & TableOfReal: To Correlation (columns)", U"djmw", 20101111)
192 INTRO (U"Create a @Correlation matrix from the selected @TableOfReal and the @GaussianMixture.")
193 NORMAL (U"We start by calculating the ClassificationTable @@GaussianMixture & TableOfReal: To ClassificationTable|from "
194 "the data and the GaussianMixture@.")
195 NORMAL (U"Nex we calculate correlations between the %%columns% of the ClassificationTable: cell [%i,%j] of the "
196 "correlation matrix will then contain the value:")
197 EQUATION (U"%p[%i] \\.c %p[%j] / (||%p[%i]||\\.c ||%p[%j]||), ")
198 NORMAL (U"where %p[%i] is the data in the %i-th column of the classification table and ||%p[%i]|| is its Euclidean norm. "
199 "The index %i runs from 1 to the number of components in the mixture.")
200 NORMAL (U"Because all the elements in a column are positive numbers, i.e. probabilities, all correlations will be positive numbers too.")
201 MAN_END
202
203 MAN_BEGIN (U"GaussianMixture & TableOfReal: To ClassificationTable", U"djmw", 20101122)
204 INTRO (U"Create a @ClassificationTable from the selected @TableOfReal and the @GaussianMixture.")
205 NORMAL (U"The classification table is a matrix with the same number of rows as the selected #TableOfReal "
206 "object. The number of columns equals the number of components in the mixture. "
207 "Cell [%i,%j] of the classification table contains the probability "
208 "that the data in row %i of the TableOfReal belongs to component %j of the mixture.")
209 MAN_END
210
211 MAN_BEGIN (U"GaussianMixture & TableOfReal: To GaussianMixture (CEMM)...", U"djmw", 20230801)
212 INTRO (U"Find the best @@GaussianMixture@ from the data according to an iterative Component-wise @@expectation-maximization|Expectation-Maximization@ for Mixtures algorithm by which components may be deleted.")
213 ENTRY (U"Settings")
214 TERM (U"##Minimum number of components")
215 DEFINITION (U"defines the minimum number of components that have to survive the minimization process. If a value of zero is chosen, all components will survive and no deletions will take place.")
216 TERM (U"##Tolerance of minimizer")
217 DEFINITION (U"defines when to stop optimizing. If the relative difference between the likelihoods at two successive "
218 "iteration steps differs by less then the tolerance we stop, i.e. when |(%L(%i-1)-%L(%i))/%L(%i)| < %%tolerance%. ")
219 TERM (U"##Maximum number of iterations")
220 DEFINITION (U"defines another stop criterion. Iteration stops whenever the number of iterations reaches this value.")
221 TERM (U"##Stability coefficient lambda")
222 DEFINITION (U"defines the fraction of the total covariance that is added to the covariance of each component to "
223 "prevent these matrices from becoming singular.")
224 TERM (U"##Criterion based on")
225 DEFINITION (U"defines whether the function to be optimized is the log likelihood or the related mininum description length.")
226 ENTRY (U"Algorithm")
227 NORMAL (U"The component-wise optimization algorithm is described in @@Figueiredo & Jain (2002)@ where the function to be optimized "
228 "is the minimum description length defined as:")
229 EQUATION (U"%L(\\te,%Y) = %N/2 \\Si__%m=1_^^%k^ ln(%n\\al__%k_/12) + %k/2 ln(%n/12) + %k(%N+1)/2 - ln %p(%Y|\\te),")
230 NORMAL (U"where %k is the number of components, %N is the number of parameters of one component "
231 "(i.e. %d+%d(%d+1)/2 for a full covariance matrix of dimension %d with means and %d+%d for a diagonal "
232 "matrix with means), and %n is the number of data vectors. The term ln %p(%Y|\\te) is the log likelihood of the data "
233 "given the model.")
234 NORMAL (U"For the optimization we either optimize the complete function %L(\\te,%Y) or only the likelihood ln %p(%Y|\\te) term.")
235 MAN_END
236
237 MAN_BEGIN (U"GaussianMixture & TableOfReal: To Table (BHEP normality tests)...", U"djmw", 20190728)
238 INTRO (U"Tests the data in the @TableOfReal that belong to the components of the @GaussianMixture for normality "
239 "according to an adapted version of the @@BHEP multivariate normality test@.")
240 ENTRY (U"Setting")
241 TERM (U"##Beta")
242 DEFINITION (U"determines the smoothing parameter of the data. If %beta equals zero the smoothing is determined "
243 "automatically for each component of the mixture separately as: ")
244 EQUATION (U"%beta = 1/(\\Vr2) (2%p+1)^^1/(%p+4)^ %n^^1/(%p+4)^,")
245 NORMAL (U"where %n is the effective number of elements in the component, and %p is the dimension of the data.")
246 MAN_END
247
248 MAN_BEGIN (U"TableOfReal: To GaussianMixture (row labels)...", U"djmw", 20101101)
249 INTRO (U"Creates a @@GaussianMixture@ from the selected @TableOfReal. The number of mixture components is determined by the number of different row labels.")
250 ENTRY (U"Setting")
251 TERM (U"##Covariance matrices are")
252 DEFINITION (U"defines whether the complete covariance matrices in the mixture have to be calculated or only the diagonal.")
253 MAN_END
254
255 MAN_BEGIN (U"HMMObservationSequence", U"djmw", 20140117)
256 INTRO (U"An HMMObservationSequence models a sequence of observations. The observation sequence can be generated "
257 "by the @HMM or it can be used to train a model.")
258 MAN_END
259
260 MAN_BEGIN (U"HMMStateSequence", U"djmw", 20101010)
261 INTRO (U"An HMMStateSequence models the sequence of states that an @HMM has traversed.")
262 MAN_END
263
264 MAN_BEGIN (U"HMM", U"djmw", 20130410)
265 INTRO (U"A HMM is a Hidden Markov Model. Markov models are often used to model observation sequences. "
266 "The fundamental assumption in a Markov model is that the probability of an observation (event) can only "
267 "depend on the previous observation. "
268 "A HMM can be visualised as a graph with a number of %%states%. If two states are connected, the graph has a line that connects them. "
269 "The following picture shows a HMM with two states, labeled \"Rainy\" and \"Sunny\". "
270 "Each state can emit three symbols (these are not visible in the graph).")
271 SCRIPT (5, 5,
272 U"Create simple HMM: \"weather\", \"no\", \"Rainy Sunny\", \"Walk Shop Clean\"\n"
273 "Draw: \"no\"\n"
274 "Remove\n")
275 INTRO (U"For an introduction into HMM's see @@Rabiner (1989)@.")
276 MAN_END
277
278 MAN_BEGIN (U"HMM: Create simple HMM...", U"djmw", 20101009)
279 INTRO (U"Creates a @@HMM|Hidden Markov Model@ from given states and observation symbols.")
280 ENTRY (U"Settings")
281 TERM (U"##Name")
282 DEFINITION (U"determines the name (for the list of objects).")
283 TERM (U"##States")
284 DEFINITION (U"determines the number of and the names of the states.")
285 TERM (U"##Symbols")
286 DEFINITION (U"determines the number and the names of the observation symbols.")
287 NORMAL (U"You can define a (not hidden) Markov model by leaving either the States or the Symbols field empty.")
288 NORMAL (U"The model is initialised with equal probabilities for all the transitions and emissions.")
289 MAN_END
290
291 MAN_BEGIN (U"HMM: Extract transition probabilities", U"djmw", 20101020)
292 INTRO (U"Extract the transition probabilities of the selected @@HMM@ as a @@TableOfReal@.")
293 NORMAL (U"The row label shows the %%from% state and the column label the %%to% state, therefore the cell element "
294 "in row %i and column %j shows the probability of making a transition from state %i to state %j.")
295 MAN_END
296
297 MAN_BEGIN (U"HMM: Extract emission probabilities", U"djmw", 20101020)
298 INTRO (U"Extract the emission probabilities of the selected @@HMM@ as a @@TableOfReal@.")
299 NORMAL (U"The row label shows the %%from% state and the column label the %%to% symbol, therefore the cell element "
300 "in row %i and column %j shows the probability of emitting symbol %j from state %i.")
301 MAN_END
302
303 MAN_BEGIN (U"HMM & HMM: Get cross-entropy...", U"djmw", 20101017)
304 INTRO (U"Calculates the cross-entropy between the two selected @@HMM@ models based on observation sequences.")
305 ENTRY (U"Settings")
306 TERM (U"##Observation length")
307 DEFINITION (U"defines the number of observations that have to generated.")
308 TERM (U"##Symmetric")
309 DEFINITION (U"defines whether the symmetric formula is used in the calculation.")
310 ENTRY (U"Algorithm")
311 NORMAL (U"The cross-entropy is a measure of the distance between two models \\la__1_ and \\la__2_. It is defined as")
312 EQUATION (U"%D(\\la__1_,\\la__2_) = 1/%N (log %p(%O__2_|\\la__1_) - log %p(%O__2_|\\la__2_)),")
313 NORMAL (U"where %O__2_ is an observation sequence of length %N generated by model \\la__2_.")
314 NORMAL (U"The symmetrized version is:")
315 EQUATION (U"%D__%s_(\\la__1_,\\la__2_) = (%D(\\la__1_,\\la__2_) + %D(\\la__2_,\\la__1_))/2.")
316 MAN_END
317
318 MAN_BEGIN (U"HMM & HMMObservationSequence: Get cross-entropy", U"djmw", 20101017)
319 INTRO (U"Calculates the cross-entropy between the selected @@HMM@ model and the @@HMMObservationSequence@.")
320 NORMAL (U"The cross-entropy is a useful upper bound for the entropy of a model. An approximation to the cross-entropy for a model on a observation sequence %O of length %N is: ")
321 EQUATION (U"%H(%O) = -1/%N log %p(%O),")
322 NORMAL (U"where %p(%O) is the probability of the observation sequence given the model.")
323 MAN_END
324
325 MAN_BEGIN (U"HMM & HMM & HMMObservationSequence: Get cross-entropy", U"djmw", 20101017)
326 INTRO (U"Get the (symmetric) cross-entropy for the two selected @HMM models and an observation sequence.")
327 NORMAL (U"See @@HMM & HMM: Get cross-entropy...@.")
328 MAN_END
329
330 MAN_BEGIN (U"HMM: To HMMObservationSequence...", U"djmw", 20101010)
331 INTRO (U"Use the selected @HMM as a generator for an observation sequence.")
332 ENTRY (U"Settings")
333 TERM (U"##Start state")
334 DEFINITION (U"defines the state in which the HMM starts. If a zero is given the start state is randomly chosen according to the start probabilities.")
335 TERM (U"##Number of observations")
336 DEFINITION (U"defines the number of observations to generate. For models of %%finite% duration such as left-to-right models, the HMM generator may stop before this number is reached.")
337 MAN_END
338
339 MAN_BEGIN (U"HMM: Get transition probability...", U"djmw", 20101010)
340 INTRO (U"For the selected @HMM get the probability to make a transition from one state to the other.")
341 MAN_END
342
343 MAN_BEGIN (U"HMM: Get emission probability...", U"djmw", 20101010)
344 INTRO (U"For the selected @HMM get the probability that in a given state a particular symbol will be emitted.")
345 MAN_END
346
347 MAN_BEGIN (U"HMM: Get start probability...", U"djmw", 20101010)
348 INTRO (U"For the selected @HMM get the probabilities that the model will start in a particular state.")
349 MAN_END
350
351 MAN_BEGIN (U"HMM: Get p (time, state)...", U"djmw", 20101010)
352 INTRO (U"For the selected @HMM get the probability that after a given number of time steps the HMM will be in "
353 "a particular state.")
354 MAN_END
355
356 MAN_BEGIN (U"HMM: Get p (time, state, symbol)...", U"djmw", 20101010)
357 INTRO (U"For the selected @HMM get the probability that after a given number of time steps the HMM will be in "
358 "a particular state and emits a certain symbol.")
359 NORMAL (U"This probability is the product of the %%probability being in particular state at that time (index)% and the %%probability of emitting a certain symbol in that state%.")
360 MAN_END
361
362 MAN_BEGIN (U"HMM: Get probability staying in state...", U"djmw", 20101010)
363 INTRO (U"For the selected @HMM get the probability that it stays exactly the given number of times in that state.")
364 NORMAL (U"This probability is %\\al__%%ii%_^^numberOfTimes-1^(1 - %\\al__%%ii%_),\n"
365 "where \\al__%%ii%_ is the probability of staying in state %i.")
366 MAN_END
367
368 MAN_BEGIN (U"HMM: Get expected duration in state...", U"djmw", 20101010)
369 INTRO (U"For the selected @HMM get the number of time units that the system is expected to stay in that state.")
370 MAN_END
371
372 MAN_BEGIN (U"HMM & HMMStateSequence: Get probability", U"djmw", 20101010)
373 INTRO (U"Get the natural logarithm of the probability that the selected @@HMMStateSequence|state sequence@ was generated by the selected @HMM.")
374 MAN_END
375
376 MAN_BEGIN (U"HMM & HMMObservationSequence: Get probability", U"djmw", 20101010)
377 INTRO (U"Get the natural logarithm of the probability that the selected @@HMMObservationSequence|state sequence@ was generated by the selected @HMM.")
378 ENTRY (U"Algorithm")
379 NORMAL (U"Viterbi")
380 MAN_END
381
382 MAN_BEGIN (U"HMM: Set transition probabilities...", U"djmw", 20101010)
383 INTRO (U"Sets the probabilities for making a transition from one state to all other states.")
384 ENTRY (U"Settings")
385 TERM (U"##Probabilities")
386 DEFINITION (U"the list of transition probabilities from the given state. "
387 "The values given will be scaled as probabilities. A zero is used to mark a transition that will never occur. ")
388 ENTRY (U"Examples")
389 NORMAL (U"For a three state model the input \"1 3 7\" will result in the same probabilities as the input \"0.1 0.3 0.7\".")
390 MAN_END
391
392 MAN_BEGIN (U"HMM: Set emission probabilities...", U"djmw", 20101010)
393 INTRO (U"Sets the probabilities for emitting the symbols from the state.")
394 NORMAL (U"The values given will be scaled as probabilities. ")
395 ENTRY (U"Examples")
396 NORMAL (U"For an HMM with four symbols the input \"1 3 3 3\" will result in the same probabilities as the input \"0.1 0.3 0.3 0.3\".")
397 MAN_END
398
399 MAN_BEGIN (U"HMM: Set start probabilities...", U"djmw", 20101010)
400 INTRO (U"Sets the probabilities that the model starts in the particular states.")
401 NORMAL (U"The values given will be scaled as probabilities. ")
402 MAN_END
403
404 MAN_BEGIN (U"HMM & HMMObservationSequence: To TableOfReal (bigrams)...", U"djmw", 20101019)
405 INTRO (U"Get a table with bigrams and marginals form the selected @HMMObservationSequence and the @HMM.")
406 NORMAL (U"The entry at row %i and column %j shows how often the %j-th symbol follows the %i-th symbol in the observation sequence.")
407 ENTRY (U"Remark")
408 NORMAL (U"The row and colum marginals for the first and the last element in the obsevation sequence will not be equal because there is no transition to the first and no transition from the last one.")
409 MAN_END
410
411 MAN_BEGIN (U"HMMObservationSequence: To TableOfReal (bigrams)...", U"djmw", 20101019)
412 INTRO (U"Get a table with bigrams form the selected @HMMObservationSequence.")
413 NORMAL (U"See also @@HMM & HMMObservationSequence: To TableOfReal (bigrams)...@.")
414 MAN_END
415
416 MAN_BEGIN (U"HMM & HMMObservationSequences: Learn...", U"djmw", 20111130)
417 INTRO (U"Train the transition and emission probabilities of the @HMM from the observations.")
418 ENTRY (U"Algorithm")
419 NORMAL (U"The Baum-Welch @@expectation-maximization@ procedure. It uses the forward and backward procedures to (re)estimate the parameters until convergence is reached.")
420 MAN_END
421
422 MAN_BEGIN (U"Bishop (2006)", U"djmw", 20101026)
423 NORMAL (U"C.M. Bishop (2006): %%Pattern recognition and machine learning%. Springer.")
424 MAN_END
425
426 MAN_BEGIN (U"Figueiredo & Jain (2002)", U"djmw", 20101229)
427 NORMAL (U"Mario A.T. Figueiredo & Anil K. Jain (2002): \"Unsupervised learning of finite mixture models.\" "
428 "%%IEEE Transactions on Pattern Analysis and Machine Intelligence% ##24(3)#: 381\\--396.")
429 MAN_END
430
431 MAN_BEGIN (U"Rabiner (1989)", U"djmw", 20101017)
432 NORMAL (U"L.R. Rabiner (1989): \"A tutorial on Hidden Markov Models and selected applications in speech recognition.\" %%Proceedings of the IEEE% #77: 257\\--286.")
433 MAN_END
434
435 MAN_BEGIN (U"Tenreiro (2009)", U"djmw", 20101113)
436 NORMAL (U"C. Tenreiro (2009): \"On the choice of the smoothing parameter for the BHEP goodness-of-fit test.\" "
437 "%%Computational Statistics and Data Analysis% #53: 1038\\--1053.")
438 MAN_END
439
440 MAN_BEGIN (U"Zhang et al. (2003)", U"djmw", 20101122)
441 NORMAL (U"Zhihua Zhang & Chibiao Chen & Jian Sun & Kap Luk Chan (2003): \"EM algorithms for Gaussian mixtures with "
442 "split-and-merge operation.\" %%Pattern Recognition% #36: 1973\\--1983.")
443 MAN_END
444
445 }
446
447 /* End of file manual_HMM.cpp */