AmpersandTV / pymc3-hmm

Hidden Markov models in PyMC3
Other
94 stars 13 forks source link

Support negative-binomial observations in the Horseshoe sampler #101

Closed xjing76 closed 2 years ago

xjing76 commented 2 years ago

Here is a functionally working branch of HSstep with NB expansion. However, in terms of sampling results of betas. the result is still a bit off.

brandonwillard commented 2 years ago

I've pushed some of the updates mentioned in my comments.

xjing76 commented 2 years ago

I just added the missing polyagamma requirement to the CI test setup. We still need coverage for some lines, though. @xjing76, can you add tests for those cases?

Yes!

xjing76 commented 2 years ago

Did some additional exploration of the convergence issue with NB expansion. We found that the HS step would converge very slowly towards the true beta.

So I did some more exploration, on the NegativeBinomial portion itself. And I set up the problem without the HSstep.

For Ndraws = 50 Even settingbeta as a Normal prior, with transformation (exp or `abs) on theeta, would some what affect the ability for the NUTS sampler to converge unless the initial values starts very closely from thetrue_beta`.

However, with Metropolis sampling on beta the convergence much better with same number of draws. I am not 100% sure where the issue is coming from

https://gist.github.com/xjing76/1fe297253adb5a58c721c6cc4f38b446