Question: Please provide R code where relevant. Consider a 3 - state HMM that has observations from gamma distributions ( gamma - HMM ) . A

Please provide R code where relevant. Consider a 3-state HMM that has observations from gamma distributions (gamma-HMM). A
gamma distribution has probability density function
f(x)=()x-1e-x, for x>0,
where >0 is the shape parameter and >0 is the rate parameter. The file Assign4gammahmm.txt
on the resources webpage contains a series of data that can be modelled using a 3-state gamma-
HMM. Download the file to a directory on your computer, open RStudio, and call
x - dget("C:/.../Assign4gammahmm.txt")
to load the data and save it in the vector x in R, where C:dots represents the folder location of
your file.
(a) Write down the state-dependent distribution in each state. That is, write down the expres-
sions of f(xt|Ct=1),f(xt|Ct=2), and f(xt|Ct=3).
[3 marks]
(b) Fit a 3-state gamma-HMM to the data in x using the function HMMest in R. Report the
parameter estimates.
[2 marks]
(c) For the model in (b), use the function Viterbi in R to find the Viterbi path, i.e., the most
likely sequence of states. Plot the classified data using the Viterbi path. That is, plot the
data and use different colors to represent different states. Attach a copy to your assignment.
[3 marks]
Please provide R code where relevant. Consider a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!