ARR2

Description

Developed by (Kohns et al. 2024), it is similar to the R2-D2 prior (Zhang et al. 2022) but for autoregression.

Definition

\[ \begin{align*} \phi_i &\sim \text{normal}\left(0, \frac{\sigma^2}{\sigma_{y}^2}\tau^2\psi_i\right) \\ \tau^2 &= \frac{R^2}{1 - R^2} \\ R^2 &\sim \text{beta}(\mu_R,\sigma_R) \\ \psi &\sim \text{Dirichlet}(\xi_1,\dotsc,\xi_p) \\ \sigma^2 &\sim p(\sigma^2) \\ \end{align*} \]

Things to specify

  • Prior on \(\sigma^2\)
  • \(\xi_1 \dotsc \xi_p\) (concentration parameters corresponding to lag coefficients)
  • \(\mu_R\) and \(\sigma_R\) (location and precision of \(R^2\) prior

Stan code

data {
  int<lower=1> T; // number of time points
  vector[T] Y; // observations
  int<lower=0> p; // AR order
  // concentration vector of the Dirichlet prior
  vector<lower=0>[p] cons;
  // data for the R2D2 prior
  real<lower=0> mean_R2;  // mean of the R2 prior
  real<lower=0> prec_R2;  // precision of the R2 prior
  real<lower=0> sigma_sd; // sd of sigma prior
  // variance estimates of y
  real<lower=0> var_y;
}

parameters {
  vector[p] phi; // AR coefficients
  simplex[p] psi; // decomposition simplex
  real<lower=0, upper=1> R2; // coefficient of determination
  real<lower=0> sigma; // observation model sd
}

transformed parameters {
  real<lower=0> tau2 = R2 / (1 - R2); // Equation 18
  vector[T] mu = rep_vector(0.0, T);
  for (t in (p+1):T) {
    for (i in 1:p) {
      mu[t] += phi[i] * Y[t-i]; // Equation 16
    }
  }
}

model {
  // priors
  phi ~ normal(0, sqrt(sigma^2/var_y * tau2 * psi));  // Equation 17
  R2 ~ beta(mean_R2 * prec_R2, (1 - mean_R2) * prec_R2);  // Equation 19
  sigma ~ normal(0, sigma_sd);  // Equation 20
  psi ~ dirichlet(cons);        // Equation 21
  // likelihood
  Y ~ normal_lpdf(mu, sigma);   // Equation 15
}

References

Kohns, David, Noa Kallioinen, Yann McLatchie, and Aki Vehtari. 2024. “The ARR2 Prior: Flexible Predictive Prior Definition for Bayesian Auto-Regressions.” May 31, 2024. http://arxiv.org/abs/2405.19920.
Zhang, Yan Dora, Brian P. Naughton, Howard D. Bondell, and Brian J. Reich. 2022. “Bayesian Regression Using a Prior on the Model Fit: The R2-D2 Shrinkage Prior.” Journal of the American Statistical Association 117 (538): 862–74. https://doi.org/10.1080/01621459.2020.1825449.