Datatype ordered some times give correct result, real gives correct result but different order

Hi, my model is training parameter mu, and tau

When setting parameter

ordered[N] mu

the model gives partially correct result. 1 of the 4 chains reveals the true value.
c459bd4d2ee2f2f244ad6e421e0b6af
87512b463de6fb90d2d5928dde3eb00

When setting parameter

real mu[N]

All chains sampels the correct results but in different order.
image
image

Becasue the order of result are’t the same, the rhat is really high.

Is there anyway to get correct results but with ordered results?

Because of different order in chains, I cannot get the 95% credit interval for the results. Or do I have to manually set the fit object to correct the results?

I’ll repeat my response to the issue:

We have much more efficient built-ins for HMMs now. See:

We just haven’t gotten around to updating the user’s guide. @charlesm93 will hopefully write up a chapter for the user’s guide soon.

HMMs are a mixture model, and those are hard to identify. I’d suggest starting with @betanalpha’s case study to get a better sense of the problems and ways to mitigate them:

https://betanalpha.github.io/assets/case_studies/identifying_mixture_models.html

1 Like