Possible to fit this time series model in brms?

Election forecasting has, in recent years, come to rely on models like those described in Jackman (2005):

y_{i} \sim \mathrm{Normal}(\mu_{i}, \sigma_{i}) \\ \mu_{i} = \alpha_{t[i]} +\delta_{j[i]} \\ \alpha_{t} \sim \mathrm{Normal}(\alpha_{t-1}, \omega), t = 2, ..., T

Here, poll y is modelled as the function of some grand mean \alpha that varies over each day in the data and a set of house effects, \delta, due to persistent biases present in each polling company’s methods.

Importantly, \alpha_{t} is itself modelled as a function of \alpha_{t-1}. I know that brms can handle autoregressive elements, but can it do so for anything other than the dependent variable?

It’s worth noting also that often there are missing days in the data too.

Hola,

Well for those kind of models you can use atsar package. Still have some struggle with the documentation and performance but is a good start. If you look a bit in the repository you find the stan code , and tou can play a bit with it to get your model fit

Hope that helps you :)

1 Like