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

Possible bug in explain_forecast without lag explanation #365

Open
martinju opened this issue Nov 17, 2023 · 0 comments
Open

Possible bug in explain_forecast without lag explanation #365

martinju opened this issue Nov 17, 2023 · 0 comments

Comments

@martinju
Copy link
Member

There seems to be a bug in the test "forecast_output_arima_numeric_no_lags":

test_that("forecast_output_arima_numeric_no_lags", {
# TODO: Need to check out this output. It gives lots of warnings, which indicates something might be wrong.
expect_snapshot_rds(
explain_forecast(
model = model_arima_temp,
y = data[1:150, "Temp"],
xreg = data[, "Wind"],
train_idx = 2:148,
explain_idx = 149:150,
explain_y_lags = 0,
explain_xreg_lags = 0,
horizon = 3,
approach = "independence",
prediction_zero = p0_ar,
group_lags = FALSE,
n_batches = 1,
timing = FALSE
),
"forecast_output_arima_numeric_no_lags"
)
})

A warning is thrown whenever predict_model is called. The warning is
Warning in matrix(): data length [2] is not a sub-multiple or multiple of the number of rows [3]
and comes from the following line:

xreg_pred <- matrix(newreg[i, ], horizon)

Althoug this is just a warning, I suspect it causes erroronous behavior.

@jonlachmann: Since you know this code the best, do you mind taking a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant