0
$\begingroup$

I am using ARIMA for some time series models and some of them were not stationary and needed differencing. So then I used the differenced data for the model. I also split it for training and testing:

X = sales2['diff_1'].values
size = int(len(X) * 0.70)
train, test = X[0:size], X[size:len(X)]

so some of the data changed to negatives after and now when I make predictions some of the data is negative which is impossible.. do i just take the abs value or is there some procedure I am not aware of to do before making predictions?

$\endgroup$
2
  • $\begingroup$ The fact that your original variable is non-negative suggests that the difference form of the model is inappropriate. That is, when the original variable is close to zero, the difference is constrained to not make the original variable less than zero, so the normal assumption is invalid. Without seeing your data it's difficult to know what the correct form of your model should be, but you could consider a log-transform of the original data. This would make differences equivalent to percentage changes. $\endgroup$
    – njp
    Mar 6 at 21:27
  • $\begingroup$ Thanks I will try that . Not sure if the data was close to zero in that particular model but I will check and try log transform $\endgroup$
    – vanetoj
    Mar 7 at 23:10

0

Your Answer

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

Browse other questions tagged or ask your own question.