2
$\begingroup$

I have been meaning to fit an exponential smoothing model to a monthly series that looks like the one below: enter image description here

When I decompose the series it is almost evident that we have seasonality and also there seems to be an exponential trend in the series. Here is the result: enter image description here

I first used ets function to apply it on my training set and the diagnostic was an ETS model with additive error, but neither seasonality nor trend:

fit2 <- ets(training)
fit2

ETS(A,N,N) 

Call:
 ets(y = training) 

  Smoothing parameters:
    alpha = 0.4596 

  Initial states:
    l = 354.3194 

  sigma:  155.3593

     AIC     AICc      BIC 
365.3796 366.4231 369.2672 

And the Ljung-Box test also looks fine:

fit2 %>% checkresiduals()

    Ljung-Box test

data:  Residuals from ETS(A,N,N)
Q* = 2.235, df = 3, p-value = 0.5251

Model df: 2.   Total lags used: 5

When I plot the forecasts for 4 months ahead, it seems to be a straight line, as the model doesn't capture the dynamics of the series: enter image description here

Now I have 2 questions:

  • Do I need to detrend & deseaonalize the times series with lag 1 and lag 12 differencing before applying an ets model on it. Because I heard from Mr. Hyndman on a datacamp tutorial that we just have to plug in the series into ets so, I am a bit confused here. If I use HoltWinter function I will get a different result, but I don't know the difference between these two.
  • Do this model seems legitimate and correct? I am not sure why it could not capture the dynamics here but since there is a seamingly polynomial trend here I thought that might lead to ets diagnose the trend to N, but what about seasonality? why it cannot be catpured?

Thank you very much for your advice in advance I really appreciate it.

$\endgroup$
6
  • 1
    $\begingroup$ Does your series have a unit root or a seasonal unit root? If not, why would you consider taking lag 1 or lag 12 differences? That would introduce a unit-root moving-average component and double (taken together, quadruple) your error variance. Briefly, removing a deterministic trend and/or non-unit-root seasonality by differencing is a bad idea. $\endgroup$ Commented Dec 3, 2021 at 18:36
  • $\begingroup$ Thank you very much for your reply Mr. Hardy. I am afraid I don't know yet how to discern if my series have a unit root for example. Could you please let me know how I could detect that? $\endgroup$ Commented Dec 3, 2021 at 18:39
  • 1
    $\begingroup$ You could eyeball and you could apply a unit root test and a seasonal unit root test. Looking at the graph, I do not see a unit root in your series. Regarding tests, see e.g. the help file for the auto.arima function from the forecast package in R. But if your series is short (say, under 40 observations for the unit root test and under $40m$ observations for the seasonal unit root test with a seasonal frequency $m$ – these are very rough numbers), the formal tests will be of limited use. I would trust eyeballing more than test results for short series. $\endgroup$ Commented Dec 3, 2021 at 18:41
  • $\begingroup$ I used ndiffs function for this and the result of kpss and pp were 0, while the result of adf was 1. So do we actually have seasonality here and if so why the model don't capture it? I also try to fit other models as well. Just wanted to understand the diagnostic here. $\endgroup$ Commented Dec 3, 2021 at 18:46
  • 1
    $\begingroup$ The tests you mention do not deal with seasonality. Again, with a series as short as yours it is no wonder the ADF test cannot reject the null of a unit root. But I got you right, the KPSS test cannot reject stationarity either. Looking at the graph, I would bet on stationarity. $\endgroup$ Commented Dec 3, 2021 at 19:02

1 Answer 1

2
$\begingroup$

Do I need to detrend & deseasonalize the times series with lag 1 and lag 12 differencing before applying an ets model on it?

Does your series have a unit root or a seasonal unit root? If not, why would you consider taking lag 1 or lag 12 differences? (Eyeballing your series does not suggest that.) Each would introduce a unit-root moving-average component into your process and increase your error variance (the first would double it, the other I am not sure by how much). In general, removing a deterministic trend and/or non-unit-root seasonality by differencing is not a good idea.

$\endgroup$
7
  • $\begingroup$ Thank you for your message. Since I am very new to this field, I still don't understand why despite the decompose result we don't have seasonality here? is it because of the fact the series is short then? and if so is it the reason why the forecast values are just a straight line? $\endgroup$ Commented Dec 3, 2021 at 19:28
  • 1
    $\begingroup$ @AnoushiravanR, you may or may not have actual seasonality. Its estimated pattern may be strong or weak. If it is weak, modelling it might introduce more variance in your forecasts than it would reduce bias in them, so it would be detrimental. If it is strong, go ahead and model it using dummy variables, Fourier terms, SARIMA or any other technique. Just think twice before (seasonally) differencing a series that does not have a (seasonal) unit root. $\endgroup$ Commented Dec 3, 2021 at 19:32
  • $\begingroup$ Oh my god, I understand now. I got the function wrong now I used nsdiffs and applied seas and ocsb tests and they both returned 0. So based on the documentation since the seasonality strength exeeds 0.64 maybe we should apply differencing. But I guess ets can detect it automatically. As is the case with auto.arima too. $\endgroup$ Commented Dec 3, 2021 at 19:49
  • 1
    $\begingroup$ If nsdiffs returned 0 then I suppose you do not need to difference. And let me reiterate: only a very special case of seasonality requires differencing. A strong seasonal pattern does not require (or even warrant) seasonal differencing unless there is a unit root component there (which is rarely the case in my experience and which the plot of your series does not seem to suggest). $\endgroup$ Commented Dec 3, 2021 at 20:28
  • 1
    $\begingroup$ @AnoushiravanR, I am here for the fun of learning and helping others learn. No worries, your words are a great form of thanking me. Good luck with your project! $\endgroup$ Commented Dec 4, 2021 at 8:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.