IBTimpliedvola (MatLab R2007b)

compute the implied volatility as an interpolation of the real data (func = 1) or as a convex function of moneyness (else). Required by XFGIBT01.m XFGIBT02.m.

Download File

Click the button to demonstrate a graph view. 
Notice: This content requires Java Runtime Environment.
Java Applet and JavaScript should be allowed on your browser.

Fri, July 27 2012 by Dedy Dwi Prastyo

iv = IBTimpliedvola(S, K, T, func)

- Stoc Price, Strike price, Time to maturity Type of function

- Implied volatility


Description: IV = IBTimpliedvola(99, 100, [], [])


function[iv] = IBTimpliedvola(S, K, T, func)
  if size(S)~=size(K)
      error('impliedvola: S and K must have the same size')
  end
  if func == 1 % Interpolated for the real data, see XFGIBT05: EurexVolatilities_rawData19
        global X Y Z
        if (K<=6630)
              iv=interp2(X,Y,Z,6630,T,'spline');
        else
              if (K>=6675)
                     iv=interp2(X,Y,Z,6675,T,'spline');
              else
                     iv=interp2(X,Y,Z,K,T,'spline');
              end
        end
  else          % Parabola   
        X = S./K;          
        iv = (-0.2./(log(X).^2+1))+0.3;              % M.Fengler (3.78) page 82
  end