ComeçarComece de graça

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 exercício faz parte do curso

ARIMA Models in Python

Ver curso

Instruções do exercício

  • Use the .get_forecast() method of the arima_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.

Exercício interativo prático

Experimente este exercício completando este código de exemplo.

# 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)
Editar e executar o código