>
|
|
First let us import prices of S&P 500 call options available on October 27, 2006.
>
|
|
This data can be stored in a DataFrame.
>
|
|
Extract data from this DataFrame.
Value of the underlying, risk-free rate and dividend yield.
Extract exercise dates and times for which data is available.
>
|
|
>
|
|
Implied volatilities for options maturing in December 2006.
>
|
|
| (1.5) |
Extract a subset of the DataFrame corresponding to the observations in December 2006:
>
|
|
Compute the implied volatility for these dates and plot the results:
>
|
|
>
|
|
Implied volatilities for options maturing in December 2007.
>
|
|
| (1.6) |
Extract a subset of the DataFrame corresponding to the observations in December 2007:
>
|
|
Compute the implied volatility for these dates and plot the results:
>
|
|
>
|
|
We will use the following model for the volatility surface.
>
|
|
| (1.7) |
We can compute the corresponding Black-Scholes price as a function of strike and maturity.
>
|
|
| (1.8) |
We can use non-linear fitting routines from the statistics data to find the values of that best fit our data. Construct a matrix of parameters and a vector of the corresponding value of the objective function.
>
|
|
>
|
|
>
|
|
Here is the corresponding implied volatility function.
>
|
|
| (1.10) |
>
|
|
>
|
|
Here is another way to estimate these parameters.
>
|
|
>
|
|
Here is the corresponding implied volatility function.
>
|
|
| (1.12) |
>
|
|
>
|
|
We can compare both fits with the actual implied volatilities.
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|
>
|
|