| compute_residual_diagnostics | R Documentation |
Whether a fitted model's error looks like unpredictable noise, or still
has structure left in it: a Ljung-Box test for residual autocorrelation,
a Shapiro-Wilk normality test, and the residual ACF with its Box-Jenkins
confidence band. Generic across every registered model – only needs
fc_tib's ds/yhat and test_df's ds/y.
compute_residual_diagnostics(fc_tib, test_df)
fc_tib |
A tibble with |
test_df |
A tibble with |
A list with residuals (tibble of ds/resid), ljung_box_p,
shapiro_p (each NA if there isn't enough overlapping data),
acf_df (tibble of lag/acf), ci (the confidence bound), and n.
ds <- as.Date("2024-01-01") + 0:29
fc_tib <- tibble::tibble(ds = ds, yhat = 100)
test_df <- tibble::tibble(ds = ds, y = 100 + rnorm(30))
compute_residual_diagnostics(fc_tib, test_df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.