Skip to content

How to correctly plot step length gamma distributions using the converged means and standard deviations of a fitted model summary? #93

Answered by bmcclintock
matt-needle asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@matt-needle
Comment options

Answer selected by bmcclintock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants