How to Log transformation Fable VAR model

Viewed 36

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.

1 Answers

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.

Related