Structural time series with seasonality, sampling very slowly

Yes @wds15 you are right in that rescaling closer to unit variance would be better. I got the scales from a run with no priors, the sigmas are small because there are too many time points with too little evidence, so the underlying latent time series changes slowly. That is also why it is so hard to sample, for there is a strong correlation over the dependency chain (of successive days).

It could make sense to try whitening the latent series by scaling to unit variance and by decorrelating: Sample independent ‘innovations’, and cumsum over them in the transformed parameters block.

I tried adapt_delta=0.95 after writing my reply above. That erased the divergent transitions from the chains. Thanks for the tip with stepsize.

@peopletrees, consider the whitening approach suggested above if you start doing serious inference. The current model is slow to run, even while being faster than the original. ;)

Oops, there is a typo in the code: y_seasonal[165] should be y_seasonal[365] obviously.
(And sorry, I messed up this reply while trying to edit it.)

1 Like