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.
Este ejercicio forma parte del curso
ARIMA Models in Python
Instrucciones del ejercicio
- 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.
Ejercicio interactivo práctico
Prueba este ejercicio y completa el código de muestra.
# 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)