lindermanlab / ssm

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

Multiple-trial analysis #136

Closed aleksejs-fomins closed 1 year ago

aleksejs-fomins commented 3 years ago

Dear Colleagues,

We have recently started using your toolbox, in particular the HMM in our lab and it looks to produce interesting results on our preliminary analyses. However, there is one feature we still have not figured out how to use.

Our data involves repeated measurements over multiple trials performed by a mouse. Each trial takes the same amount of time. Also, multiple channels are simultaneously recorded in the mouse brain. This results in 3D data matrices (trials x time x channel).

We would like to analyse all trials simultaneously. We could of course concatenate all trials consecutively, producing one long trial. However, there are intervals between trials, and these intervals we do not record. Thus, the concatenation procedure would produce biased transition matrices. Does your code support multiple trial inputs? Could you advise us how to proceed

Best, Aleksejs

bagibence commented 3 years ago

Hi! I'm not part of the developer team, just a user, but maybe I can help :)

You can feed multiple trials to the models by transforming your trials x time x channel arrays into a list of time x channel matrices. (Also see #37)

aleksejs-fomins commented 3 years ago

Thanks a bunch. We will try it, but judging by #37 it should work. This great project could really benefit from a detailed documentation (unless it is already there and I am blind)