How to achieve strictly positive forecasts?

I am working on a time series whose values are strictly positive. Working with various models including AR, MA, ARMA, etc, I couldn’t find an easy way to achieve strictly positive forecasts.

I’m using R for doing my forecasts, and all that I could find was forecast.hts {hts} that has a positive parameter described here:

Forecast a hierarchical or grouped time series, package hts

## S3 method for class 'gts':
forecast((object, h,
  method = c("comb", "bu", "mo", "tdgsf", "tdgsa", "tdfp", "all"),
  fmethod = c("ets", "rw", "arima"), level, positive = FALSE,
    xreg = NULL, newxreg = NULL, ...))

positive
    If TRUE, forecasts are forced to be strictly positive

http://www.inside-r.org/packages/cran/hts/docs/forecast.gts

Any suggestions for non-hierarchical time series? What about generalization on using other constraints like minimum, maximum, etc?

Even if not implemented in R, suggestions on articles, models or helpful general variable transformations would be appreciated.

Answer

With the forecast package for R, simply set lambda=0 when fitting a model. For example:

fit <- auto.arima(x, lambda=0)
forecast(fit)

Many of the functions in the package allow the lambda argument. When the lambda argument is specified, a Box-Cox transformation is used. The value λ=0 specifies a log transformation. So setting lambda=0 means the logged data are modelled, and when forecasts are produced, they are back-transformed to the original space.

See http://www.otexts.org/fpp/2/4 for further discussion.

Attribution
Source : Link , Question Author : Ho1 , Answer Author : Rob Hyndman

Leave a Comment