Mixture and Hidden Markov Models With R Extended Version Download
Mixture and Hidden Markov Models With R Extended Version Download
Visit the link below to download the full version of this book:
https://medipdf.com/product/mixture-and-hidden-markov-models-with-r/
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
To Lieke and Pien
I.V.
vii
viii Preface
justification, having become the lingua franca of statistics and data science. R is
open source, freely available, and has an active user community such that anyone
interested can add and contribute packages implementing new analytical methods.
As all required tools are freely available, the readers should be able to replicate the
example analyses on their own computers, as well as adapting the analyses for their
own purposes. To aid in this process, all the code for running the examples in the
book are provided online at https://depmix.github.io/hmmr/. Moreover, the datasets
and special purpose functions written for this book are available as an R package
called hmmr. Section 1.2 provides pointers for getting started with R and provides
all the basics that are needed to then understand and apply subsequent analyses and
examples.
Acknowledgments
Writing and producing a book is rarely done in isolation, and this one is no
exception. Many people have contributed by asking tough research questions,
providing data, LATEX, and Sweave() advice. Below is a list of people that we
know have surely contributed in important ways. We know that this list is likely
incomplete, so just let us know if you ought to be on the list so we can include you
in future editions. We would like to thank Achim Zeileis for getting us started with
the combination of LATEX, Sweave() and make files to produce this book. We would
like to thank Chen Haibo for providing the S&P-500 data example, Brenda Jansen
for sharing her balance scale data, Gilles Dutilh and Han van der Maas for sharing
their speed-accuracy data, the Water Corporation of Western Australia for providing
the Perth dams data on their website, Bianca van Bers for sharing the dimensional
change card sorting task data, Han van der Maas for sharing the conservation of
liquid data, Maartje Raijmakers for sharing the discrimination data, and Emmanouil
Konstantinidis for sharing the Iowa gambling task data. Finally, we would like to
thank John Kimmel, Marc Strauss, and Laura Briskman for inviting us to write this
book and organize things Springer.
This book has been taking us a while to complete. On a more personal level,
many people have been by our sides during that period. Maarten would like to thank
Gabriel and Hunter for being wondering and wonderful human beings, and Ria and
Jan for their love and support. Ingmar would like to thank Jaro for her love and
support.
In producing the examples in this book, R is mainly run at its default settings. A
few modifications were made to render the output more easily readable; these were
invoked by the following chunk of R-code:
This replaces the standard R prompt > by R>. For compactness, digits = 4
reduces the number of digits shown when printing numbers from the default of 7.
Note that this does not reduce the precision with which these numbers are internally
processed and stored.
We use set.seed(x) whenever we generate data or fit models such that the
exact values of data and fitted parameters may be replicated. When fitting models,
this is necessary, because random starting values are generated (see Sect. 2.3.6 for
more details).
We use a typewriter font for all code; additionally, function names are
followed by parentheses, as in plot(), and class names (a concept that is explained
in Chap. 1) are displayed as in “depmix.” Furthermore, boldface is used for package
names, as in hmmr.
The following symbols are used throughout the book:
A Transition matrix
π Initial state probability vector
S Stochastic state variable
s Realization of the state variable
Y Stochastic (possibly multivariate) observation variable
y Realization of the observation variable
z Covariate, possibly multivariate
θ Total model parameter vector; θ = (θ pr , θ tr , θ obs )
θ pr Subvector of the parameter vector with parameters of the prior model
θ tr Subvector of the parameter vector with parameters of the transition model
xi
xii Settings, Appearance, and Notation
θ obs Subvector of the parameter vector with parameters of the observation model
T Total number of time points
N Number of states of a model
f Probability density function
P Probability distribution
H Hessian matrix
Contents
xiii
xiv Contents
7 Extensions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.1 Higher-Order Markov Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231
7.1.1 Reformulating a Higher-Order HMM as a
First-Order HMM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233
7.1.2 Example: A Two-State Second-Order HMM for
Discrimination Learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
7.2 Models with a Distributed State Representation . . . . . . . . . . . . . . . . . . . . . . . 237
7.3 Dealing with Practical Issues in Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
7.3.1 Unbounded Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
7.4 The Classification Likelihood . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
7.4.1 Mixture Models. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
7.4.2 Hidden Markov Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
7.5 Bayesian Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
7.5.1 Sampling States and Model Parameters . . . . . . . . . . . . . . . . . . . . . . 249
7.5.2 Sampling Model Parameters by Marginalizing
Over Hidden States . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265