Unrolling ARMA forecast
Now you will use the model that you trained in the previous exercise arma
in order to forecast the absolute value of the Amazon stocks dataset. Remember that sometimes predicting the difference could be enough; will the stocks go up, or down; but sometimes the absolute value is key.
The results object from the model you trained in the last exercise is available in your environment as arma_results
. The np.cumsum()
function and the original DataFrame amazon
are also available.
This exercise is part of the course
ARIMA Models in Python
Exercise instructions
- Use the
.get_forecast()
method of thearima_results
object and select the predicted mean of the next 10 differences. - Use the
np.cumsum()
function to integrate your difference forecast. - Add the last value of the original DataFrame to make your forecast an absolute value.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Make arma forecast of next 10 differences
arma_diff_forecast = arma_results.____(steps=____).____
# Integrate the difference forecast
arma_int_forecast = ____
# Make absolute value forecast
arma_value_forecast = arma_int_forecast + amazon.____
# Print forecast
print(arma_value_forecast)