First let us import prices of S&P 500 call options available on October 27, 2006.
>
|

|
| (1.1) |
>
|
|
| (1.2) |
Extract data from this matrix.
>
|
|
| (1.3) |
>
|
|
| (1.4) |
Value of the underlying, risk-free rate and dividend yield.
>
|
|
| (1.5) |
>
|
|
| (1.6) |
>
|
|
| (1.7) |
Extract times and strikes for which data is available.
>
|
|
>
|
|
>
|
|

| (1.8) |
>
|
|
Implied volatilities for options maturing in December 2006.
>
|
|
| (1.9) |
>
|
|
>
|
|
| (1.10) |
>
|
, 'xcoords' = convert(LinearAlgebra[Column](L1, 1), 'list'), thickness = 3, gridlines = true, color = red, axes = BOXED)](/support/helpjp/helpview.aspx?si=8950/file05984/math149.png)
|
Implied volatilities for options maturing in December 2007.
>
|
|
| (1.11) |
>
|
|
>
|
|
| (1.12) |
>
|
, 'xcoords' = convert(LinearAlgebra[Column](L2, 1), 'list'), thickness = 3, gridlines = true, color = red, axes = BOXED)](/support/helpjp/helpview.aspx?si=8950/file05984/math184.png)
|
We will use the following model for the volatility surface.
>
|
|
| (1.13) |
We can compute the corresponding Black-Scholes price as a function of strike and maturity.
>
|
|

| (1.14) |
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.
>
|
|
| (1.15) |
>
|
|
| (1.16) |
>
|
|
| (1.17) |
Here is the corresponding implied volatility function.
>
|
|

| (1.18) |
>
|
|
>
|
|
Here is another way to estimate these parameters.
>
|
|
| (1.19) |
>
|
|
>
|
![beta2 := Statistics:-NonlinearFit(Sigma(S0, T, K), B, U, [T, K], 'parameternames' = [alpha[1], alpha[2], alpha[3], alpha[4], alpha[5], alpha[6]], 'output' = 'parametervector')](/support/helpjp/helpview.aspx?si=8950/file05984/math306.png)
|
| (1.20) |
Here is the corresponding implied volatility function.
>
|
|

| (1.21) |
>
|
|
>
|
|
We can compare both fits with the actual implied volatilities.
>
|
, 'xcoords' = convert(LinearAlgebra[Column](L1, 1), 'list'), thickness = 3, color = red)](/support/helpjp/helpview.aspx?si=8950/file05984/math354.png)
|
>
|
|
>
|
|
>
|
|
>
|
, 'xcoords' = convert(LinearAlgebra[Column](L2, 1), 'list'), thickness = 3, color = red)](/support/helpjp/helpview.aspx?si=8950/file05984/math375.png)
|
>
|
|
| (1.22) |
>
|
|
| (1.23) |
>
|
|