ComeçarComece de graça

Effect of mean model on volatility predictions

In practice, returns and volatility are modeled in separate processes. Typically the mean assumptions influence predicted returns, but have a minor effect on the volatility estimations.

In this exercise, you will examine the impact of GARCH model mean assumptions on volatility estimations by comparing two GARCH models. They have been defined with different mean assumptions and fitted with S&P 500 data.

The model with "constant mean" assumption has results saved in cmean_result, and estimated volatility saved in cmean_vol. The model with "AR(1)" or 1-lag autoregressive mean assumption has results saved in armean_result, and estimated volatility saved in armean_vol. The matplotlib.pyplot and numpy modules have been imported as plt and np respectively.

Este exercício faz parte do curso

GARCH Models in Python

Ver curso

Instruções do exercício

  • Print out and review model fitting summaries of cmean_result and armean_result.
  • Plot the volatility estimation cmean_vol and armean_vol from both models.
  • Use .corrcoef() function from numpy package to calculate the correlation coefficient.

Exercício interativo prático

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

# Print model summary of GARCH with constant mean
print(____.____())
# Print model summary of GARCH with AR mean
print(____.____())

# Plot model volatility 
plt.plot(____, color = 'blue', label = 'Constant Mean Volatility')
plt.plot(____, color = 'red', label = 'AR Mean Volatility')
plt.legend(loc = 'upper right')
plt.show()

# Check correlation of volatility estimations
print(np.____(____, ____)[0,1])
Editar e executar o código