Unbalanced panel data random walk


I have a 200+ times series that I would like to smooth out. My simple approach is to just use an intercept only rolling regression, basically just a random walk, and then take the mean of each alpha_t.

I’ve tested this on a few examples. It is capturing the trends in the data as I would expect and is good enough for my needs.

I’m assuming I can just pass a 2-d shape parameter into the GaussianRandomWalk and estimate multiple series simultaneously. I’ve tested this and it works.

The problem I have is that many of the times series are different lengths. The result of the model seems to work well, but it is very slow to estimate.

I’m wondering if anyone has any advice on how to handle unbalanced situations like this.


I guess you use a for-loop to build GaussianRandomWalk with different length/shape?

Hmmm I guess you can try writing a custom log-likelihood using DensityDist, but the for-loop seems unavoidable.