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

Error in wrap_arima(): When calling refit #390

Open
atrevidoantonio opened this issue Jan 11, 2024 · 0 comments
Open

Error in wrap_arima(): When calling refit #390

atrevidoantonio opened this issue Jan 11, 2024 · 0 comments

Comments

@atrevidoantonio
Copy link

Hello,

I am experiencing an issue when calling refit on a test dataframe object. I've called this multiple times in the past and never experienced this issue and am unsure how to proceed to correct the error. This is the error that is printed when I call refit on my test tsibble,

Error in `mutate()`:
ℹ In argument: `arima = (function (object, ...) ...`.
Caused by error in `wrap_arima()`:
! wrong length for 'fixed'

Here's my code,

library(tidyverse)
library(dplyr)
library(ggplot2)
library(extrafont)
library(ggh4x)
library(ggpubr)
library(tsibble)
library(fable)
library(fabletools)
library(feasts)

market_df <- read_csv("./market_data.csv")

market_ts <-
  market_df |>
  as_tsibble(index = date,
             key = c(market, state, census_region, region, sb_region))
train <- filter(market_ts, date <= "2023-05-25")
test <- filter(market_ts, date > "2023-05-25")

linear_fits <- train |>
  model(
    tslm = TSLM(appointment_value ~ national_tv + local_tv + youtube + radio + meta + search + liposuction + season() + trend()),
    tslm_lipo = TSLM(appointment_value ~ national_tv + local_tv + youtube + radio + meta + search + liposuction + season_week + season_year),
    arima = ARIMA(appointment_value ~ national_tv + local_tv + youtube + radio + meta + search + liposuction, stepwise = FALSE)
  )

linear_fits |>
 refit(test)
  accuracy()

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