ComenzarEmpieza gratis

Generating one-step-ahead predictions

It is very hard to forecast stock prices. Classic economics actually tells us that this should be impossible because of market clearing.

Your task in this exercise is to attempt the impossible and predict the Amazon stock price anyway.

In this exercise you will generate one-step-ahead predictions for the stock price as well as the uncertainty of these predictions.

A model has already been fitted to the Amazon data for you. The results object from this model is available in your environment as results.

Este ejercicio forma parte del curso

ARIMA Models in Python

Ver curso

Instrucciones del ejercicio

  • Use the results object to make one-step-ahead predictions over the latest 30 days of data and assign the result to one_step_forecast.
  • Assign your mean predictions to mean_forecast using one of the attributes of the one_step_forecast object.
  • Extract the confidence intervals of your predictions from the one_step_forecast object and assign them to confidence_intervals.
  • Print your mean predictions.

Ejercicio interactivo práctico

Prueba este ejercicio y completa el código de muestra.

# Generate predictions
one_step_forecast = results.____(____=___)

# Extract prediction mean
mean_forecast = one_step_forecast.____

# Get confidence intervals of  predictions
confidence_intervals = one_step_forecast.____

# Select lower and upper confidence limits
lower_limits = confidence_intervals.loc[:,'lower close']
upper_limits = confidence_intervals.loc[:,'upper close']

# Print best estimate  predictions
print(____)
Editar y ejecutar código