How to correctly plot step length gamma distributions using the converged means and standard deviations of a fitted model summary? #93
-
I am working on recreating the default plots of the function shape = mean^2 / sd^2 When plotting the distributions, they have a similar form as those given by the default plot, but the scale of the y-axis is very different. Have I got something fundamentally wrong here, or is momentuHMM calculating the distributions differently under the hood?
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
If you check out the details in the help file ( "The state-dependent densities are weighted by the frequency of each state in the most probable state sequence (decoded with the function So if you weight the densities by the state frequencies from the Viterbi algorithm, your plot should match that produced by |
Beta Was this translation helpful? Give feedback.
If you check out the details in the help file (
?plot.momentuHMM
), you'll find the following:"The state-dependent densities are weighted by the frequency of each state in the most probable state sequence (decoded with the function
viterbi
). For example, if the most probable state sequence indicates that one third of observations correspond to the first state, and two thirds to the second state, the plots of the densities in the first state are weighted by a factor 1/3, and in the second state by a factor 2/3."So if you weight the densities by the state frequencies from the Viterbi algorithm, your plot should match that produced by
plot.momentuHMM
.