1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – whuber
    Commented Dec 28, 2021 at 13:54
  • $\begingroup$ BTW, a principled and powerful way to identify a useful transformation of the variable is described and illustrated at stats.stackexchange.com/a/74594/919. By making and examining a simple plot you often can arrive at a good solution to your problem. $\endgroup$
    – whuber
    Commented Dec 29, 2021 at 20:27

2 Answers 2

3
$\begingroup$

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.

$\endgroup$
0
$\begingroup$

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

$\endgroup$
1
  • 1
    $\begingroup$ To set lambda to 0 in a Box-Cox transformation is to take the log. $\endgroup$ Commented Dec 28, 2021 at 11:31

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.