1

Data - Monthly Rainfall of a region for the past 20 years

Objective - To Forecast for the next 2 years

I have used a SARIMA model and predictions have been done using R. but one of the forecast value is negative. how to tackle this problem in R? as it is rainfall forecast it cannot be in negative.

noob
  • 65
  • 6
  • It would be worthwhile contemplating why you believe a negative forecast is problematic. Often it's not really a problem at all. You should definitely *not* try to cure the problem with some *ad hoc* method like automatically transforming the variables (*e.g.*, taking logarithms), because that risks making the forecast *worse* while hiding all evidence of the problem. Instead, study the model's applicability using diagnostic tests and graphics. – whuber Dec 28 '21 at 13:54
  • BTW, a principled and powerful way to identify a useful transformation of the variable is described and illustrated at https://stats.stackexchange.com/a/74594/919. By making and examining a simple plot you often can arrive at a good solution to your problem. – whuber Dec 29 '21 at 20:27

2 Answers2

3

In cases where the outcome has to be non-negative, it is common to model the logarithm $z=\log(y)$ instead of $y$ and then predict using $\exp(z)$ (which is guaranteed to be non-negative).

In your setup, I think you may find an additional problem: that in some periods rain might be zero. This would certainly be a problem with daily data; it might be less so with monthly data.

Nick Cox
  • 48,377
  • 8
  • 110
  • 156
F. Tusell
  • 7,733
  • 19
  • 34
0

You can set lambda to 0, which will perform a Box-Cox transformation to your data. See more information here: https://otexts.com/fpp2/transformations.html

AlexB
  • 101
  • 2