MCMC is really slow even with C++ compiler

Hi Alex!

Thanks for your response!

Have you done some prior predictive checks? Exponential and StudentT are fat-tails distributions and exp(50) can give super huge values, so I would check it the slowness isn’t coming from this. Depending on your domain and domain expertise, these priors could be justified, or maybe they are too wide :man_shrugging:

Essentially all of the code is from a tutorial, but 50 is supposed to reflect the large uncertainty in the degrees-of-freedom parameter. Honestly I don’t know personally whether this is justified. My experience with the model is at this point in time very new, so I don’t know exactly which shapes are reasonable to assume for the prior. I could try a prior predictive check to see which values I get though.

What’s the scale of the data? If they are on a huge scale, that can get very hard to sample. In these cases, standardizing the data usually helps.

I’m not sure what the difference is between data scale and data size is. If you by scale mean the range it varies between approximately -2.5 and 2.5. Tell me if it is something else!

What’s the size of your data? If it’s very big, then the model taking a long time to sample is less surprising.

log_returns is of size 2516, and I’m doing 2000 samples. This is exactly the same as in the book. I guess my main concern is that the author said the same code took him 15-20 minutes, which makes me wonder whether my set up is flawed. Surely he could have a better GPU, etc. but I don’t know whether this is enough to explain the performance difference. In my experience differences these significant, with my simulation taking hours and his a couple of minutes, is usually due to optimization problems. Of course, as you’re stating, it could be the model setup itself (initial guesses, etc.) that causes the problem, but since we both use the same code, wouldn’t such a difference probably stem from either computer differences or changes in the packages, etc. over time?

Also, don’t forget to update your PyMC to the brand new 3.9.1 if you can :wink: There are lots of new features in there!

That’s the one I’m using! :slight_smile:

Do you think this sort of performance is normal given the set up described or does something seem unoptimized besides the model set up?