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 state HMM that has observations from gamma distributions gammaHMM A
gamma distribution has probability density function
for
where is the shape parameter and is the rate parameter. The file Assigngammahmm.txt
on the resources webpage contains a series of data that can be modelled using a state gamma
HMM. Download the file to a directory on your computer, open RStudio, and call
x dgetC:Assigngammahmm.txt
to load the data and save it in the vector in where ots represents the folder location of
your file.
a Write down the statedependent distribution in each state. That is write down the expres
sions of and
marks
b Fit a state gammaHMM to the data in using the function HMMest in R Report the
parameter estimates.
marks
c For the model in b use the function Viterbi in to find the Viterbi path, ie 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.
marks
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
