This repository implements Algorithm 1 of the paper Bayesian order identification of ARMA models with projection predictive inference by McLatchie et al. (2022).
Inputs: Time series data alpha
and pct
- Perform Ljung-Box test for stationarity to data
${y_t}$ and print warning message if failed - Fit a linear reference model (AR) to these data observations
${y_t}$ withBRMS
and lag parameter$P^\ast$ - Apply the model selection heuristic to this reference AR model to get some restricted AR lag value
$P^\perp$ - Fit a linear restricted model (AR) to
${y_t}$ withBRMS
and this new restricted lag parameter$P^\perp$ - Extract the residuals from this AR restricted model, denote these residuals
${\epsilon_t}$ - Fit a linear reference model (MA) to these residuals
${\epsilon_t}$ withBRMS
and lag parameter$Q^\ast$ - Apply the model selection heuristic to this reference MA model to get some restricted MA lag value
$Q^\perp$
Returns: The restricted lag values
This algorithm requires a custom search heuristic, detailed in Figure 1 by McLatchie et al. (2022), which is available in a personal fork of projpred
available for download through
devtools::install_github("yannmclatchie/projpred@time_series)