lindermanlab / ssm

Bayesian learning and inference for state space models
MIT License
559 stars 197 forks source link

Input driven observations ("GLM-HMM") #125

Closed zashwood closed 3 years ago

zashwood commented 3 years ago

Hi Scott,

I hope this message finds you well. Here is the "InputDrivenObservations" class that I wrote in order to perform the analyses for our recent paper. I also wrote a notebook ("2b Input Driven Observations ("GLM-HMM")") to showcase a recovery analysis using this class when the inputs and GLM weights are in the parameter regimes described in our paper. I checked too that my code returns no error messages when calling the test_sample(T=10, K=4, D=1, M=2) function within your tests/test_basics.py script; however, I have not updated the list of observation classes within that test script to include the InputDrivenObservations class, as this class is currently written for a one-dimensional output (D=1; it throws error messages if you try to call it for D>1). I wrote it for D=1 because this was what we needed for our paper, but would be happy to work on extending it to D>1 if this is something that you think would be useful (in that case, I think it would also be important to allow users to specify more than one value for C, the number of distinct classes for each dimension of output).

Anyway, thanks again to you and your lab for writing this beautiful package! I have learned a lot by working with it, and am looking forward to the code review process for this pull request.

Best,

Zoe

slinderman commented 3 years ago

Thanks @zashwood! This is really impressive work. The GLM-HMM notebook is great—I like all the analyses you've done. If you could remove that one todo comment I'll merge it into master!

zashwood commented 3 years ago

Thanks very much for reviewing this Scott, and for being willing to integrate this into master! I really appreciate it!