Home Page > > Details

MAT 515 Paper

 MAT 515 Paper

Due Wednesday, May 20 before 6pm
We have learned the the Baum-Welch algorithm to estimate the parameters of a
hidden Markov model. It is an iterative algorithm to maximize the complete-data
log likelihood (CDLL). The procedure alternates between 2 steps in each iteration:
the E step and the M step.
There are two files in the folder Lesson Plans on d2l that can help you.
(1). The following file has the Baum-Welch algorithm for 2-state Poisson-HMM.
Lesson_6_MAT_515.pdf
Page 1 describes the algorithm. Page 2 has the formulas for the E step.
Page 3 has the formulas for the M step.
(2). The following file has the MatLab code for 2-state Poisson-HMM.
Baum_Welch_Poisson_HMM.pdf
On page 3 of the file, you will find the following code,
beta_mat(107,:) = ones(1,2);
for t=107:-1:2
% students should write code here to make backward probabilities
end
The purpose of that code is that all the vectors β~
t are put into the rows of a matrix.
The last row of that matrix is β~
T and this is just a row vector [1, 1].
The For Loop starts from t = 107 and goes down by 1, until t = 2. In each iteration,
from t = 107 to t = 2, it makes a β~
t and puts that into a row of the matrix. These
are the backward probabilities.
1
Part 1. Using the MatLab code to help you with this paper.
In the code, where it says:
% students should write code here to make backward probabilities
write your code there. Once you have done that, you can run this Matlab program.
The program will model the earthquakes data by using the 2-state Poisson-HMM.
The program initializes the parameters:
Γ(1, 2) = 0.1 and Γ(2, 1) = 0.1 λ1 = 10 and λ2 = 30 δ1 = 0.5
It runs for 31 iterations and displays the parameters.
TASK
Make a Table. The first column of this table should contain the iteration number,
the second and third column should be λ1 and λ2. The table should show the result
of the program for iteration number 1, 2, 3, 4, 5, 10, 20, 30.
For example, the fifth row of the table tells us what is λ1 and λ2 after 5 iterations.
What is the Γ matrix after 31 iterations?
Note: the initial parameters are iteration number zero.
Part 2. We want to model the earthquake data using the 3-state Poisson-HMM.
Initial parameters:
Γ(1, 2) = 0.1, Γ(1, 3) = 0.1, Γ(2, 1) = 0.1, Γ(2, 3) = 0.1, Γ(3, 1) = 0.1, Γ(3, 2) = 0.1
λ1 = 10, λ2 = 20, λ3 = 30, δ1 = 0.3333, δ2 = 0.3333.
TASK
Make the changes in the MatLab code so that instead of 2-state Poisson-HMM,
the program uses a 3-state Poisson-HMM to model the earthquake data.
Make a Table. The first column of this table should contain the iteration number.
The second column should be λ1. The third and 4-th column should be λ2 and λ3.
The table should show the result of the program for iteration number 1, 2, 3, 4,
5, 10, 20, 30.
2
Part 3. We want to model the FTSE 100 data using the 3-state Normal-HMM.
Financial Times Stock Exchange 100 Index is made of 100 companies listed in
London Stock Exchange.
The data contains daily closing returns on the FTSE 100 index from 2 April 1986,
(451 days, 450 returns).
This includes zero returns imputed on public holidays.
The time period includes the famous market crash in October, 1987.
Data is contained in the text file, ftse.txt
daily return = 100 log(s(t)/s(t t 1)),
where s(t) = index value at the close on day t.
For the m-state Normal-HMM, the Baum-Welch algorithm is similar to the one
for m-state Poisson-HMM. The difference is that in the M step for each iteration,
the Poisson distribution is replaced by the Normal distribution with mean µj and
variance µ
2
j
.
That means, the parameter λj
is replaced by the parameters µj and µ
2
j
.
If you have done Maximum Likelihood estimator (MLE) before, you should not be
surprised that the estimator for µj
is a weighted average of the outcomes xj
.
In fact, the MLE for µj has the same formula as the MLE for λj
. How un-surprising.
For the detail of the M step in each iteration for the Normal-HMM, see the file:
M_step_Baum_Welch_Normal_HMM.pdf
Initial parameters:
Γ(1, 2) = 0.1, Γ(1, 3) = 0.1, Γ(2, 1) = 0.1, Γ(2, 3) = 0.1, Γ(3, 1) = 0.1, Γ(3, 2) = 0.1
µ1 = =0.2, µ2 = 0.025, µ3 = 0.2 δ1 = 0.3333, δ2 = 0.3333
σ1 = σ2 = σ3 = 1.363257
Note that our initial parameters for µj and σj are consistent with the sample
mean and sample variance. At least one µj
is less than sample mean, and at least
one µj
is higher than sample mean.
TASK
Make the changes in the MatLab code so that instead of m-state Poisson-HMM,
the program uses a 3-state Normal-HMM to model the data of 450 daily returns.
(a). Show the result of the program for iteration number 1, 2, 3, 4, 5, 10, 15.
• show µ1, µ2 and µ3.
• show σ1, σ2, and σ3.
Display the entries of the transition probability matrix x after 15 iterations.
(b). Discuss why for this data of 450 daily returns of FTSE 100, the Normal
distribution is not a good model.
Use what you have learned from probability and statistics. For example, you may
refer to the histogram, outliers, standard deviation, any statistical test, etc.
(c). Perform your own experiment. For example, you can run the program with
different initial parameters, or you can try the 4-state Normal-HMM.
Important
Here is something to keep in mind: For Part 3 of this paper, you should write this
up in such a way that you feel comfortable to discuss this in a job interview. You
want to impress your future employer that you have analyzed the FTSE 100 index,
for 450 daily returns, which includes the market crash of October, 1987. You want
to emphasize that the Hidden Markov Model that you build has greater explanatory
power than the alternative hypothesis of a Normal distribution.
Hand in the tasks you are asked to do. Include your computer program for the
3-state Normal-HMM. You do not need to include the data for the 450 daily returns.
Put everything into one single pdf file.
Note: For this paper, you can use MatLab, or R, or Python. For this paper,
please do not copy code from classmates or from the internet. If you decide to use
R or Python, then whenever it asks you to change MatLab code, you can write your
own R or Python code instead.
Contact Us - Email:99515681@qq.com    WeChat:codinghelp
Programming Assignment Help!