0
$\begingroup$

I have a timeseries, where I know the volume will be about 20% lower in the future (because of a sudden policy change). I want my time series model (ETS) to pick up this change reliably, but I'm not sure how to structure this problem.

I've thought about including a covariate (which is 1 before the break and 0.8 after) or just shrinking the forecasts to 80%, but I doubt, that these are useful solutions.

What other useful approaches would be possible?

$\endgroup$
1
$\begingroup$

The Bayesian framework is apt for including prior information and giving you prediction intervals. The mcp package can model AR(N) time series and the docs has a section on forecasting with future change points.

In your case, it sounds like you may have an AR(1) stable intercept-only trend which shifts 20% down. I briefly present how I would approach it and refer to the article above for more details why this works.

Here, I model a change to 80% of the current intercept, 30 days after the last observed data point (with an uncertainty of SD = 10 days). Say x is your date in days and y is your volume:

    # Model current status
    model_now = list(y ~ 1 + ar(1))
    fit_now = mcp(model, data = my_data, sample = FALSE, par_x = "x")

    # Extend it to include the unobserved future segment
    model_forecast = list(
      y ~ 1 + ar(1),  # current segment
      ~ 1             # future segment
    )
    prior_forecast = c(fit_now$prior, list(
      int_2 = "int_1 * 0.8",  # 20% lower intercept
      cp_1 = "dnorm(MAXX + 30, 10)[MAXX, ]"  # Prior knowledge about when the change happens
    ))
    fit_forecast = mcp(model_forecast, my_data, prior = prior_forecast)

Now you can make predictions about the future, e.g.,

    newdata = data.frame(x = max(my_data$x) + c(10, 20, 30, 40))
    predict(fit_forecast, newdata)

Options for further refinement:

  • If your volume is counts, you may consider using another response family, e.g., mcp(..., family = poison()) or mcp(..., family = binomial()).
  • You can do e.g., int_2 = "dnorm(int_1 * 0.8, 2)" if you want to model uncertainty about the magnitude of the change too.
  • This is a very simple intercept-only model. Check the mcp docs for many more modeling options.
  • The default priors in fit_now$prior are quite vague. You can update them to better fit your problem.

Disclosure: I am the developer of mcp. The code here is for illustration only since you did not provide data.

$\endgroup$
2
  • $\begingroup$ Thank you for developing and making me aware of your package, I will take a closer look! :) Do I understand correctly, that I don't necessarily have to go "fully bayesian" to use it? So It's possible to use my frequentist model (say exponential smoothing) with mcp and use it as a wrapper to include (future) changepoints (in the trend)? Will the predictions intervals also be handled in a meaningful way? $\endgroup$ – stats-hb Jan 14 at 9:30
  • 1
    $\begingroup$ Yes, mcp does not "know" what processing occurred to the data and doesn't need to. Since smoothing itself comes with some uncertainty which is "removed" in this transition, the resulting prediction intervals will probably be a bit too narrow. BTW, arima(∞) is exponential smoothing, so some of the smoothing effect can be achieved by doing e.g. ar(3), thus having everything in one model: otexts.com/fpp2/arima-ets.html. $\endgroup$ – Jonas Lindeløv Jan 14 at 10:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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