This is a follow up to the question posed here: new_transformation not working with multiple inputs from tsibble object inside ARIMA
When passing back a CPI forecast as new_data to undo the CPI transformation, I receive an error. Any thoughts?
Here is the code:
library(fpp3)
aus_acc_fit <- aus_accommodation %>%
model(ARIMA(resp(Takings)/CPI*100 ~ trend(knots = yearquarter("2008 Q1")) + season()))
cpi_fc <- aus_accommodation %>%
model(ARIMA(CPI)) %>%
forecast(h =6) %>%
as_tsibble() %>%
select(-.model, -CPI) %>%
rename(CPI = .mean) %>%
relocate(Date, .before = State)
aus_acc_fc <- aus_acc_fit %>%
forecast(new_data = cpi_fc)
And here is the error:
Error in `mutate()`:
! Problem while computing `ARIMA(resp(Takings)/CPI * 100 ~ trend(knots = yearquarter("2008 Q1")) + season()) =
(function (object, ...) ...`.
Caused by error in `hessian.default()`:
! Richardson method for hessian assumes a scalar valued function.
Run `rlang::last_error()` to see where the error occurred.