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

[1] subscript out of bounds - What's the problem? #385

Open
USMortality opened this issue Dec 14, 2022 · 0 comments
Open

[1] subscript out of bounds - What's the problem? #385

USMortality opened this issue Dec 14, 2022 · 0 comments

Comments

@USMortality
Copy link

USMortality commented Dec 14, 2022

I am trying to calculate the accuracy of a single point forecast for 2013. Model is trained on 2010-2012 data. It produces expected result, but also throws error: [1] subscript out of bounds. How would I fix the error?

MRE:

df <- as_tsibble(data.frame(x = seq(2010:2013), y = sample(1:10, 4)), index = x)

df[1:3, ] %>%
  model(RW(y ~ drift())) %>%
  forecast(h = 1) %>%
  accuracy(df)

Result:

# A tibble: 1 × 10
  .model          .type    ME  RMSE   MAE   MPE  MAPE   MASE  RMSSE  ACF1
  <chr>           <chr> <dbl> <dbl> <dbl> <dbl> <dbl>  <dbl>  <dbl> <dbl>
1 RW(y ~ drift()) Test   -0.5   0.5   0.5   -10    10 0.0769 0.0750    NA
Warning message:
1 error encountered
[1] subscript out of bounds
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