Log transformation and model selection, Section 13.3 in Hyndman & Athanasopoulos , 3rd edition

Hi,

I’m new to forecasting and I have a (hopefully) quick question about model selections and log transformations. My question is based on Section 13.3 in Hyndman & Athanasopoulos 3rd edition.

Let’s say I’m using an ETS model and selecting it with the ETS() function. I want to ensure the forecasting distribution stays positive, so I’ll be using log transformation when fitting the model and producing a forecast. The question is: When choosing the model, should I also use the log function? The examples in the book seem to always specify the model when using log().

The data below is from the data included in the forecasting package:

egg_prices <- prices |> filter(!is.na(eggs))

Automatically selecting a model including the log transformation gives ETS(A,N,N) when looking at the report

egg_prices_modelLOG <- egg_prices |>
  model(ETS(log(eggs)))
report(egg_prices_modelLOG)

automatically selecting a model without using log transformation gives ETS(M,N,N)

egg_prices_model <- egg_prices |>
  model(ETS(eggs))
report(egg_prices_model)

Specifying a model with additive trend, like in the book gives ETS(A,A,N)

egg_prices_model_book <- egg_prices |>
  model(ETS(log(eggs) ~ trend("A")))
report(egg_prices_model_book)

Is there any rule of thumb about what to do or not to do? I'm just wondering if I can/should select a model based on non-transformed data and then use that model on log-transformed data.

Below, I have chosen to use ETS(A,N,N) which was the automatically selected model for the non-transformed series

egg_prices |>
  model(ETS(log(eggs) ~ error("A") + trend("A") + season("N"))) |>
  forecast(h = 50) |>
  autoplot(egg_prices) +
  labs(title = "Annual egg prices",
       y = "$US (in cents adjusted for inflation) ")

Referred here by Forecasting: Principles and Practice, by Rob J Hyndman and George Athanasopoulos

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.