Usage: |
{IVsurf, IVpoints} = volsurf(x, stepwidth, firstXF, lastXF, firstMat, lastMat, metric, bandwidth, p {, IVmethod})
|
Input: |
| x | n x 6 data matrix, where
the first column contains the underlying
asset prices, the second the strikes, the third
the interest rates, the fourth maturities [years],
the fifth the option prices and the sixth contains the
types of the option (1 means a call, 0 a put).
|
| stepwidth | 2 x 1 vector
determining the stepwidth of the volatility surface; the first
entry refers to the strike dimension, the second to the time to maturity
|
| firstXF | scalar
giving the lowest limit in the strike dimension of the volatility surface
|
| lastXF | scalar
giving the highest limit in the strike dimension of the volatility surface;
depending on stepwidth the actual lastXF can be lastXf+1.
|
| firstMat | scalar
giving the lowest limit of the time to maturity in the volatility surface
|
| lastMat | scalar
giving the highest limit of the time to maturity in the volatility surface;
depending on stepwidth the actual lastMat can be lastMat+1.
|
| metric | scalar
taking the values 1 or 0; specifies whether you like to have the implied
volatility surface in a moneyness metric of X/F (metric=0) or in the
original strike metric (metric=1).
|
| bandwidth | 2 x 1 vector
determining the width of bins for the Kernel smoothing.
|
| p | scalar, determines whether the Nadaraya-Watson estimator (p=0)
or the local polynomial regression (p!=0) is used.
|
| IVmethod | string, if IVmethod = "bisect" the bisection method is used,
default is Newton-Raphson
|
Output: |
| IVsurf | A matrix containing all coordinates in R2 of
the IVpoints computed for the implied volatility surface.
The first column contains the moneyness, the second
the maturity and the third the implied volatility. |
| IVpoints | A matrix which contains the coordinates in R2 of
the options used to determine the surface.
The first column contains the moneyness, the second
the maturity and the third the implied volatility. |