Include resampling over (kappa+alpha) and rho=kappa/(kappa+alpha) in WeakLimitStickyHDPHMM #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change follows Algorithm 9 and Appendix C of E. Fox dissertation 2009.
The change reparameterized
alpha
andkappa
as(alpha+kappa)
andrho=kappa/(kappa+alpha)
. We place a Gamma prior over(alpha+kappa)
and a Beta prior overrho
. TheWeakLimitStickyHDPHMM
class is updated to allow the new hyper-parameters. Further, the new classes are added to the transitions.py class to include "FullConcGibbs" classes to indicate that we are now sampling over all of the hyper-parameters in the model (rather than just the alpha and gamma parameters as before).I ran the updated model on
example-data.txt
following the code inhsmm.py
(changing the relevant model to:The result is that we now have a posterior over kappa:
![image](https://user-images.githubusercontent.com/3874391/58944328-45ee6a00-878a-11e9-9624-eb7644e514bd.png)
plt.hist([m.trans_distn.kappa for m in models])
:I'd very much appreciate it if you have any comments/suggestions/reviews.
Thanks very much