Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

volsurface Class Reference

#include <volsurface.h>

List of all members.

Public Member Functions

 volsurface (Real stockPrice, Date today, valarray< Real > strikes, valarray< Date > maturities, yieldCurve yCurve, valarray< valarray< Real > > callputprices, valarray< valarray< bool > > iscallputprices)
 Constructor.

 volsurface (Real stockPrice, Date today, yieldCurve yCurve, volsurfaceparams &params)
 Constructor.

 volsurface (valarray< valarray< Real > > volsurf)
 Constructor.

 volsurface (Real constantvol)
 Default Constructor.

 volsurface (void)
 Default Constructor.

 ~volsurface (void)
 Destructor.

Real invertBSformula (Real r, Real maturity, Real stockPrice, Real strike, Real callputPrice, bool isacall)
Real volatility (Real K, Date T)
Real variance (Real K, Date T)
Real forwardVolatility (Real K, Date t, Date T)
void setvolsurface ()
valarray< valarray< Real > > getvolsurface ()
volsurface forwardvolsurface (Date t)
 Implied volatility surface seen at time t.

volsurface shiftedYCvolsurface (Real shift)
 Implied volatility surface when the yield curve is shifted.

volsurface shiftedvolsurface (Real shift)
 Shift the implied volatility surface.


Private Attributes

Real _stockPrice
Date _today
valarray< Real_strikes
valarray< Date_maturities
yieldCurve _yieldCurve
valarray< valarray< Real > > _callputprices
valarray< valarray< bool > > _iscallputprices
valarray< valarray< Real > > _impliedvolsurface
interpolator _interpolvolsurf
bool _volsurfconst
Real _constantvol


Constructor & Destructor Documentation

volsurface::volsurface Real  stockPrice,
Date  today,
valarray< Real strikes,
valarray< Date maturities,
yieldCurve  yCurve,
valarray< valarray< Real > >  callputprices,
valarray< valarray< bool > >  iscallputprices
 

Constructor.

Parameters:
stockPrice: Current stock price
today: date of today
strikes: vectror of strikes
maturities: vector of maturities
yCurve: the yield curve
callputprices: matrix of option prices
iscallputprices: matrix indicating if we have call or put prices

Definition at line 7 of file volsurface.cpp.

References Real.

volsurface::volsurface Real  stockPrice,
Date  today,
yieldCurve  yCurve,
volsurfaceparams params
 

Constructor.

Parameters:
stockPrice: Current stock price
today: date of today
yCurve: the yield curve
params: strikes, maturities, prices, etc.

Definition at line 19 of file volsurface.cpp.

References Real.

volsurface::volsurface valarray< valarray< Real > >  volsurf  ) 
 

Constructor.

Parameters:
volsurf: volsurface

Definition at line 44 of file volsurface.cpp.

volsurface::volsurface Real  constantvol  ) 
 

Default Constructor.

Definition at line 32 of file volsurface.cpp.

References Real.

volsurface::volsurface void   ) 
 

Default Constructor.

Definition at line 38 of file volsurface.cpp.

volsurface::~volsurface void   ) 
 

Destructor.

Definition at line 50 of file volsurface.cpp.


Member Function Documentation

Real volsurface::forwardVolatility Real  K,
Date  t,
Date  T
 

Definition at line 139 of file volsurface.cpp.

References _today, Date::dayCount(), Real, and variance().

Referenced by Drift::Drift(), and forwardvolsurface().

volsurface volsurface::forwardvolsurface Date  t  ) 
 

Implied volatility surface seen at time t.

Definition at line 148 of file volsurface.cpp.

References _impliedvolsurface, _maturities, _strikes, forwardVolatility(), Integer, M, and N.

Referenced by Exotics::getTheta().

valarray< valarray< Real > > volsurface::getvolsurface  ) 
 

Definition at line 118 of file volsurface.cpp.

References _impliedvolsurface.

Real volsurface::invertBSformula Real  r,
Real  maturity,
Real  stockPrice,
Real  strike,
Real  callputPrice,
bool  isacall
 

Definition at line 55 of file volsurface.cpp.

References Call, BlackScholes::getVolatility(), Put, r, and Real.

Referenced by setvolsurface().

void volsurface::setvolsurface  ) 
 

Definition at line 68 of file volsurface.cpp.

References _callputprices, _constantvol, _impliedvolsurface, _interpolvolsurf, _iscallputprices, _maturities, _stockPrice, _strikes, _today, _volsurfconst, _yieldCurve, Date::dayCount(), invertBSformula(), N, r, Real, and yieldCurve::spotRate().

Referenced by importData::importVolSurface(), mainvolsurface(), and shiftedYCvolsurface().

volsurface volsurface::shiftedvolsurface Real  shift  ) 
 

Shift the implied volatility surface.

Definition at line 194 of file volsurface.cpp.

References _impliedvolsurface, _maturities, _strikes, Integer, M, N, and Real.

Referenced by Exotics::getVega().

volsurface volsurface::shiftedYCvolsurface Real  shift  ) 
 

Implied volatility surface when the yield curve is shifted.

Definition at line 185 of file volsurface.cpp.

References _callputprices, _iscallputprices, _maturities, _stockPrice, _strikes, _today, _yieldCurve, Real, setvolsurface(), and yieldCurve::shiftZCBRateCurve().

Real volsurface::variance Real  K,
Date  T
 

Definition at line 131 of file volsurface.cpp.

References _constantvol, _volsurfconst, Real, and volatility().

Referenced by forwardVolatility().

Real volsurface::volatility Real  K,
Date  T
 

Definition at line 122 of file volsurface.cpp.

References _constantvol, _interpolvolsurf, _today, _volsurfconst, Date::dayCount(), interpolator::interpolate(), and Real.

Referenced by GaussianProcess::BuildPath(), inputBSOption(), inputButterflySpread(), inputCallSpread(), inputPutSpread(), inputRatioCallSpread(), inputStraddle(), inputStrangle(), mainvolsurface(), and variance().


Member Data Documentation

valarray<valarray<Real> > volsurface::_callputprices [private]
 

Definition at line 35 of file volsurface.h.

Referenced by setvolsurface(), and shiftedYCvolsurface().

Real volsurface::_constantvol [private]
 

Definition at line 40 of file volsurface.h.

Referenced by setvolsurface(), variance(), and volatility().

valarray<valarray<Real> > volsurface::_impliedvolsurface [private]
 

Definition at line 37 of file volsurface.h.

Referenced by forwardvolsurface(), getvolsurface(), setvolsurface(), and shiftedvolsurface().

interpolator volsurface::_interpolvolsurf [private]
 

Definition at line 38 of file volsurface.h.

Referenced by setvolsurface(), and volatility().

valarray<valarray<bool> > volsurface::_iscallputprices [private]
 

Definition at line 36 of file volsurface.h.

Referenced by setvolsurface(), and shiftedYCvolsurface().

valarray<Date> volsurface::_maturities [private]
 

Definition at line 33 of file volsurface.h.

Referenced by forwardvolsurface(), setvolsurface(), shiftedvolsurface(), and shiftedYCvolsurface().

Real volsurface::_stockPrice [private]
 

Definition at line 30 of file volsurface.h.

Referenced by setvolsurface(), and shiftedYCvolsurface().

valarray<Real> volsurface::_strikes [private]
 

Definition at line 32 of file volsurface.h.

Referenced by forwardvolsurface(), setvolsurface(), shiftedvolsurface(), and shiftedYCvolsurface().

Date volsurface::_today [private]
 

Definition at line 31 of file volsurface.h.

Referenced by forwardVolatility(), setvolsurface(), shiftedYCvolsurface(), and volatility().

bool volsurface::_volsurfconst [private]
 

Definition at line 39 of file volsurface.h.

Referenced by setvolsurface(), variance(), and volatility().

yieldCurve volsurface::_yieldCurve [private]
 

Definition at line 34 of file volsurface.h.

Referenced by setvolsurface(), and shiftedYCvolsurface().


The documentation for this class was generated from the following files:
Note: Generated nightly - reload for latest version
Generated on Thu Dec 22 23:12:40 2005 for terreneuve by doxygen 1.3.6