lindermanlab / ssm

Bayesian learning and inference for state space models
MIT License
556 stars 200 forks source link

Hierarchical SLDS not implemented #108

Open bagibence opened 4 years ago

bagibence commented 4 years ago

Hi! I just noticed that the SLDS class doesn't seem to support hierarchical parameters anymore. Is this on purpose? If yes, I think __init__ taking the arguments hierarchical_transition_tags, hierarchical_dynamics_tags, hierarchical_emission_tags is a bit misleading and could be removed. I thought I was fitting a hierarchical model by specifying them but then saw that they're not actually used. If not, could this functionality be restored by borrowing code from HMM.__init__ or would it be much more complex than that?

bantin commented 4 years ago

Hi @bagibence, thanks for pointing this out. We're not really supporting hierarchical LDS and SLDS at the moment, and should strip out those arguments. I think implementing them in a way that is reasonably well-performing (in terms of speed) would be fairly involved, since it would likely require writing custom M-steps. For now, I'm going to take out those arguments so things aren't so confusing!

bantin commented 4 years ago

Removed unused args in e487a65. Moving to "enhancement" since this would be a nice feature.

robinvloeberghs commented 1 year ago

Hello! Is there any follow-up on this topic? I'm currently working with a LDS that has Bernoulli emissions and AR dynamics and I'm very interested to implement a hierarchical extension for both levels. I found some code in one of the branches for a hierarchical AR: https://github.com/lindermanlab/ssm/blob/e97ea4f0904cd204f392c2cfc4528ef860d71f9d/ssm/hierarchical.py

Is it possible to apply the same structure to implement a hierarchical version for Bernoulli emissions? Or does this require additional custom code for eg the M-steps?