Computational Provenance & Reproducibility Record

RAISINS - R and AI Solutions for INferential Statistics · Online Statistical Analysis Platform for Agricultural Research

Computational Provenance & Reproducibility Record ARIMA · 1.0.0 · DOI 10.5281/zenodo.23120140

Computational Provenance & Reproducibility Record

RAISINS · ARIMA Module

This Computational Provenance Record documents the statistical computing environment, software dependencies, computational provenance, and bibliographic references associated with the RAISINS ARIMA module. It is intended to support computational reproducibility and software transparency. Detailed statistical methodology, mathematical derivations, and user guidance are provided separately in the official module documentation.

Any issues or updates required please comment here

Go to the App from here

1 Module Metadata

Parameter Specification
Module ARIMA
Module Version 1.0.0
DOI 10.5281/zenodo.23120140
Document Type Computational workflow
Statistical Engine R
R Version 4.5.2
Reproducibility Execution Environment: GCP · renv-locked

2 Statistical Dependency Manifest

Package Version Repository Core Statistical Functions
stats 4.5.2 Base R ts(), diff(), window(), time(), frequency(), acf(), pacf(), Box.test(), lm(), ar(), arima.sim(), coef(), residuals()
forecast 9.0.2 CRAN auto.arima(), Arima(), forecast(), accuracy(), checkresiduals(), arimaorder(), BoxCox(), BoxCox.lambda(), na.interp(), nsdiffs(), Acf(), Pacf()
tseries 0.10-61 CRAN adf.test(), kpss.test()

3 Statistical Function Registry

Analytical Role Primary Function(s)
Automatic model selection forecast::auto.arima() (Hyndman-Khandakar algorithm)
Manual/user-specified model fitting forecast::Arima()
Multi-step forecasting forecast::forecast()
Forecast accuracy metrics forecast::accuracy()
Residual diagnostics - Ljung-Box forecast::checkresiduals() (Auto ARIMA), stats::Box.test(type = "Ljung-Box") (Manual ARIMA)
Non-seasonal stationarity testing tseries::adf.test(), tseries::kpss.test()
Seasonal unit-root testing forecast::nsdiffs(test = "ch") (Canova-Hansen)
Box-Cox transformation forecast::BoxCox(), forecast::BoxCox.lambda()
Missing-value interpolation (pre-test only) forecast::na.interp()
Autocorrelation / partial-autocorrelation diagnostics stats::acf(), stats::pacf(), forecast::Acf(), forecast::Pacf()
Train/test split extraction stats::window()

4 Default Methods & Parameters

Analysis Step / Parameter Default Method / Value
Train/Test Split
(stats::window())
Default split "whole" - 100% of the series used for fitting.
Split point Single chronological cut at floor(split_ratio × n) via window()
Accuracy When a test split is selected, error metrics calculated using accuracy(forecast(fit, h = length(test)), test); otherwise accuracy(fit) is used.
Auto ARIMA
(forecast::auto.arima())
Order search Hyndman-Khandakar stepwise algorithm (default); bounded by max.p = 4, max.q = 4, max.P = 1, max.D = 1, max.Q = 1
Search mode stepwise = TRUE, approximation = TRUE by default; both switch to FALSE (exhaustive search) when "Detailed Search" is enabled
Seasonality seasonal = FALSE by default, toggled by the "data is seasonal" checkbox
Box-Cox transform Off by default (lambda = NULL); when enabled, lambda = BoxCox.lambda(y) and biasadj = TRUE
Manual ARIMA
(forecast::Arima())
Non-seasonal order (p, d, q) Defaults to p = 1, d = 1, q = 1, each independently user-set
Seasonal order (P, D, Q) "Seasonal" toggle off by default; when enabled, defaults to P = 1, D = 1, Q = 1 at the data's frequency, except daily data (frequency 365) which is overridden to a period of 7
include.mean TRUE only when d = 0 (and, if seasonal is enabled, D = 0 as well)
Stationarity / unit-root testing
(precedes both Auto and Manual ARIMA)
ADF (tseries::adf.test()) p < 0.05 - stationary
KPSS (tseries::kpss.test()) p < 0.05 - non-stationary
Differencing loop Up to 3 successive diff() applications, re-testing ADF and KPSS after each, stopping once both agree the series is stationary
Seasonal unit-root test
(forecast::nsdiffs())
Method Canova-Hansen (test = "ch"); run only when series frequency > 1
Residual diagnostics - Ljung-Box Auto ARIMA checkresiduals(fit) (bundles the Ljung-Box test against the fitted model)
Manual ARIMA Box.test(residuals, lag = 10, type = "Ljung-Box", fitdf = (p + q) + (P + Q if seasonal))
Forecast
(forecast::forecast())
Horizon Default 5 steps ahead; user-selectable from 1 to 100
Prediction intervals 80% / 95% Confidence interval for prediction is given.

5 R Code for Key Analytical Steps

The code blocks below demonstrate the exact computation behind each reported result using AirPassengers, the monthly seasonal series present in the base R (datasets package, frequency 12).

5.1 Stationarity Screening (shared by Auto ARIMA and Manual ARIMA)

library(forecast)
library(tseries)

y_ts <- AirPassengers                       # built-in monthly series, frequency = 12
n    <- length(y_ts)

lambda <- NULL                    
#lambda <-  BoxCox.lambda(y_ts) #to apply box cox transformation

ts_test     <- na.interp(y_ts)
adf_result  <- adf.test(ts_test)
kpss_result <- kpss.test(ts_test)

# Seasonal unit root (Canova-Hansen)
seasonal_diffs <- nsdiffs(y_ts, test = "ch")

5.2 Train/Test Split

split_ratio <- 0.80                                     # "80%" training-set  
train <- window(y_ts, end   = time(y_ts)[floor(split_ratio * n)])
test  <- window(y_ts, start = time(y_ts)[floor(split_ratio * n) + 1])

5.3 Auto ARIMA (Hyndman-Khandakar)

fit_auto <- auto.arima(
  train,
  seasonal      = TRUE,          
  stepwise      = TRUE,          
  approximation = TRUE,
  lambda        = lambda,
  biasadj       = !is.null(lambda),
  max.p = 4, max.q = 4, max.P = 1, max.D = 1, max.Q = 1
)

fc_test <- forecast(fit_auto, h = length(test))
acc     <- accuracy(fc_test, test)
checkresiduals(fit_auto)                                #  Ljung-Box test

5.4 Manual ARIMA (user-specified order, same split reference)

p <- 1; d <- 1; q <- 1                                   # default (p, d, q) shown in the app
P <- 1; D <- 1; Q <- 1; use_sarima <- FALSE              # seasonal orders, off by default
period_use <- if (frequency(train) == 365) 7 else frequency(train)

fit_manual <- Arima(
  train,
  order        = c(p, d, q),
  seasonal     = if (use_sarima) list(order = c(P, D, Q), period = period_use)
                 else list(order = c(0, 0, 0)),
  lambda       = lambda,
  biasadj      = !is.null(lambda),
  include.mean = (d == 0 && (!use_sarima || D == 0))
)

fc_test_manual <- forecast(fit_manual, h = length(test))
acc_manual     <- accuracy(fc_test_manual, test)

fitdf <- (p + q) + if (use_sarima) (P + Q) else 0
Box.test(residuals(fit_manual), lag = 10, type = "Ljung-Box", fitdf = fitdf)

5.5 Forecast Beyond the Fitted Horizon

forecast(fit_auto, h = 5)          # default forecast horizon = 5 steps

Explore the entire ARIMA module in preview mode using our demo datasets. To submit suggestions or report a workflow issue, please use the discussion section below, or visit the official RAISINS website.

6 RAISINS Native Statistical Framework

RAISINS uses R for all its statistical computations. Every package used to generate major results is listed and demonstrated with examples, so results can be reproduced independently. These results are then organized and formatted on the RAISINS website along with visualisation to make them easier to use and interpret. RAISINS also has its own custom-built statistical tools for managing workflows, validating results, and generating reports. Details of these are not fully covered here, they’re shared with outside researchers only on request, and are subject to licensing terms.

7 Package References

R Core Team. (2025). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. https://www.R-project.org/

Hyndman, R. J., Athanasopoulos, G., Bergmeir, C., Caceres, G., Chhay, L., Kuroptev, K., Mücke, M., O’Hara-Wild, M., Petropoulos, F., Razbash, S., Wang, E., & Yasmeen, F. (2025). forecast: Forecasting Functions for Time Series and Linear Models (R package version 9.0.2). https://doi.org/10.32614/CRAN.package.forecast

Trapletti, A., & Hornik, K. (2025). tseries: Time Series Analysis and Computational Finance (R package version 0.10-61). https://doi.org/10.32614/CRAN.package.tseries

Feedback & Discussion