brms
brms copied to clipboard
Rolling regression/autoregressive adaptive priors
Hi Paul,
For repeated cross-sectional or panel data, we often have to account for people being clustered within surveys or time-points. One way of dealing with the time-varying variation that this induces is to include an adaptive prior such that each survey or time-point has its own intercept that varies around some grand mean.
Another way of accounting for time-varying variance or situations where we expect coefficients to change over time is to use "rolling regression" and centre the varying intercepts not on some grand mean but, instead, on the previous intercept. Likewise, we can extend this to the slopes too. For example:
y_i~ N(mu_i, sigma) mu = alpha_time[i] + beta_time[i] x_i alpha_1 ~ N(0, 10) alpha_t ~ N(alpha_t-1, sigma_alpha) for t in 2, ..., T beta_1 ~ N(0, 10) beta_t ~ N(beta_t-1, sigma_beta) for t in 2, ..., T ... plus priors on the sigmas
You might also include some covariance structure between alpha and beta too. Effectively, this models the two parameters as though they come from a gaussian random walk. There's a neat application in pymc3 here that you might find interesting.
Not sure how much work it is, but it would be great if we could have autoregressive parameters like this in brms at some point.
Thank you for this suggestions. Perhaps there is a way to express this as a correlation structure of multilevel terms. I will think about it.
Not sure how you’re planning to implement this, but it might make sense to also rely on the ar() command that most often applies to auto-regressive variables.