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


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 |>

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

egg_prices_model <- egg_prices |>

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")))

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.