Change point model

variational-bayes
#1

Dear Stan Forum,

I have some two-dimensional data of size (5-20) that requires me to fit a change point model with two straight lines.

An MCMC simulation will take 2-10 seconds to fit each model. I have about 20,000 such data sets to fit and I would like them to finish within hours not two days. Currently, I am using a MAP approach, i.e. finding the mode of the posterior. The difficulty of solving such an optimisation problem is that the model is not differentiable with respect to the change point location.

The result from STAN is good, but two seconds per model are too slow. I am wondering whether STAN could give me any point estimates without doing the full simulation? Maybe through Variational-Bayes or EM?

If someone could paste some reading material to start with, that would be great.

Cheers,

Chen

0 Likes

#2

You could always try VB and check it against MCMC, but if these are all independent fits you could just run them in parallel

edit: I’m not saying it’s a bad idea to make this run faster but most recommendations about optimization/algorithms have to be given in context of the problem and I don’t see enough in the text above. With the timings and data sizes you mention the bottleneck might not be the model but the interface.

0 Likes

#3

Stan doesn’t do EM, but you can effectively do that by marginalizing out the discrete parameters and just letting Stan optimize. There’s a change-point example in the user’s guide (latent discrete parameters chapter) that shows how to marginalize out discrete changepoints. Then everything’s differentiable.

You can probably speed up MCMC by (a) using reasonable inits to cut down warmup time, and (b) using fewer post warmup iterations. If you’re willing to consider approximate algorithms, I’m guessing you don’t need many decimal places of accuracy.

You can also try to check VB with the new K-hat stats that Yuling developed.

0 Likes