Time-series in Stan, I am new to Stan and need hints to develop the model. THANKS

Uff I don´t know! But maybe @paul.buerkner can help :)

@asael_am What you can help with is whether it is correct to have one posterior estimate for the entire time-series for each predictor. Thanks

This is a nice paper as well on limited number of times and having more individual in MVAR, if anyone is interested and going through similar challenge as I do. https://pubmed.ncbi.nlm.nih.gov/29595295/

1 Like

Sorry I dropped the ball a bit on this. Getting to individual points:

Depends heavily on the data, your research question and the available theoretical knowledge on the topic, unfortunately no general answers here. The best general approach is IMHO to design a suitable a posterior predictive check e.g. as in the Visualisation paper, but also mentioned on a lot of places on the forums. The case study at Towards A Principled Bayesian Workflow also describes this (but as “posterior retrodictive check”)

Also, if I read the results correctly, the model is unable to constrain even the sign of any effect, so it is possible that the model is too flexible for the amount of data you have.

I don’t think the process you describe is well modelled via truncation. In this case, I think you can simply avoid adding the likelihood term for the missing observations. For higher efficiency (and potentially to avoid some computational issues), you might also want to avoid having the f_ parameters for the missing timepoint-person combinations - this might need some changes to model code to handle such “ragged” array.

Given the size of the dataset you mention, I am slightly surprised you are able to fit the model. You’ve referred to MAP estimates a few times - are you just running the optimizing mode of Stan? The reason is that for these types of models my hunch would be that optimizing can run into serious problems - but I might be easily wrong on this, I am really just guessing.

The ctsem package you mention looks interesting and relevant (I’ve never used it). It appears that it uses the Kalman filter approach which should make it quite efficient, but requires Gaussian likelihood. This may however turn out to not be a big problem, so it might be worth trying how far you can get with ctsem - you can use posterior predictive checks to see how big of a problem that is (the ctsem seems to have some plots to show predictions and data already built in)

Best of luck!

1 Like