Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for autocorrelation in response variables #45

Open
eb8680 opened this issue Oct 14, 2019 · 0 comments
Open

Support for autocorrelation in response variables #45

eb8680 opened this issue Oct 14, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@eb8680
Copy link
Member

eb8680 commented Oct 14, 2019

brms supports autoregressive correlation structure on response variables via the cor argument to its fit function and the cor_arma object. It would be nice to support at least a subset of this functionality, say only AR(1) terms with grouping.

In conjunction with support for multiple response variables #42 and unobserved response variables #43 #44 and a syntax extension prev for indicating AR(1) autocorrelation, this would allow brms to provide general and highly scalable support for most multivariate structural time series models with an intuitive syntax:

x ~ 1 + prev(x) + (prev(x) | g)
y ~ 1 + (1 + x | g)

Semantically, formula language support for autocorrelation and latent response variables #44 should be backed by code generation targeting the parallel-scan algorithms for Gaussian and discrete state-space models implemented in Pyro and Funsor, so that we could work with very long time series in O(log(T)) time on parallel hardware.

That might mean implementing a vectorized pyro.markov statement upstream (analogous to the vectorized pyro.plate) and, when autocorrelation terms are included in a model, generating code where the observations are wrapped in a pyro.markov context instead of a pyro.plate. We might also need to slightly modify Pyro's HMM distributions to generate latent Markov chains and implement an elbo variant capable of exploiting this structure:

...
with pyro.markov(dim=-2, window=1):
    x = pyro.sample("x", dist.DiscreteMarkovChain(...))
    y = pyro.sample("y", dist.Normal(loc_y[..., x], scale_y), obs=y_obs)
...

cc @fritzo

@fritzo fritzo added the enhancement New feature or request label Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants