Readme file
SERIES
B
Statistical
Methodology
Inference and model choice for sequentially ordered hidden Markov models,
N. Chopin
volume 69, (2007), 269–284
This software comes with absolutely no warranty of any kind.
It is free of use for academic use only.
Otherwise, contact the author.
***************************************
This is the program (in MATLAB) and dataset corresponding to the aforementined paper.
This archive should contain the following files:
readme.txt: this file
runme.m: initialisation
shmm2_reg.m: the main routine
usa.txt: the data used in the paper
plus several short *.m files (Dirichletlpdf, Dirichletrnd, proportion)
that can be re-used in other contexts
Notes:
1. Please refer to the (hopefully clear) comments inside the MATLAB code to understand the inner logic of the program. In particular, inputs and outputs are explained in runme.m
2. By default, the observation likelihood (e.g. conditional on state) is
3rd model: y_t \sim N(a+b*x_t,s^2), wih xi=[a b s]
In the program, you will find references to two alternative models:
1st model: y_t \sim N(\xi,1)
2nd model: y_t \sim N(0,\xi^2)
Uncomment the appropriate lines to get the model you want.
3. I hope this program strikes a good balance between computational efficiency and readibility. If you want to make it faster:
- At the moment, the filtering probabilities are computed twice, see l. and 2. This is to avoid memory overflow on old systems. If you have plenty of memory, you can store these quantities the first time they are computed. The memory cost will be 8*H*t*K*(K+1)/2 in double precision, and at iteration t. An intermediate solution is to store these values from 0 to t' and do the calculations between t' and t
- The program relies on a few loops that are difficult to `vectorise'. I guess rewriting some parts of this program in C
would greatly help. (If you're willing to do so, please let me know.)
4. If I remember well, you may need the Statistics Toolbox. This program has been tested on Matlab 7.
5. Any comments most welcome.
Nicolas Chopin
ENSAE
3 Avenue Pierre Larousse
92245 Malakoff Cedex
France
E-mail: nicolas.chopin@bris.ac.uk
|