1

I would like to take advantage of Fable's ability to back transform results for a regression. Unfortunately, I have been unable to do so using a VAR model in Fable. I have tried several options such as:

    fit <- model_data_ts %>%
  model(
    aicc = VAR(vars(log(IC, E_U))),
    bic = VAR(vars(log(IC, E_U)), ic = "bic")
  )

The above code is not back transformed in the results. I can just do this manually, but wanted to understand what is not working.

Stephen Ostermiller
  • 23,933
  • 14
  • 88
  • 109
Michael
  • 11
  • 2

1 Answers1

0

The transformation will need to apply to each response variable separately.

In your example, to log() both response variables you would use:

fit <- model_data_ts %>%
  model(
    aicc = VAR(vars(log(IC), log(E_U))), 
    bic = VAR(vars(log(IC), log(E_U)), ic = "bic")
  )

Note that transformations on multivariate models is only partially supported at this stage, and things like forecasting with them is not yet implemented.

Also please provide an example dataset in future to make it easier to understand your question and check that the solution works.

  • Thank you for the answer. On clarifying question to your response. You stated, "Note that transformations on multivariate models is only partially supported at this stage, and things like forecasting with them is not yet implemented." Is that to say forecast of multivariate models is not yet implemented in Fable, or, forecasting of fitted models that have been transformed are not implemented yet? If the latter is correct, it would seem all that would need to be done it to transform the data before fitting a model. – Michael Jul 30 '22 at 01:50
  • Neither. In fable, it is possible to forecast from multivariate models and it is possible to forecast univariate transformed models. The only bit that isn't done yet is back-transforming forecasts from multivariate models. – Mitchell O'Hara-Wild Jul 30 '22 at 08:10