Calculates option's vega. More...

#include <optionVega.hpp>

Inheritance diagram for julian::OptionVega:
julian::OptionGreeksDecorator julian::OptionGreeks

Public Member Functions

 OptionVega (SmartPointer< OptionGreeks > input, double h, NumDiffScheme scheme, std::string risk_name="Vega")
 Constructor. More...
 
GreeksIntermediateResults calculateRisks (const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 calculates the option's Vega More...
 
std::map< std::string, double > getRisks (const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 returns the PV and Greek parameter More...
 
OptionVegaclone () const
 virtual copy constructor More...
 
- Public Member Functions inherited from julian::OptionGreeksDecorator
 OptionGreeksDecorator (SmartPointer< OptionGreeks > risks)
 Constructor. More...
 
- Public Member Functions inherited from julian::OptionGreeks
virtual ~OptionGreeks ()
 Destructor. More...
 

Private Member Functions

void CntrVega (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates Vega using central differencing scheme. More...
 
void FwdVega (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates Vega using forward differencing scheme. More...
 
void BwdVega (GreeksIntermediateResults &rr, const SmartPointer< MarketModel > &model, const SmartPointer< PricingEngine > &prizer, const SmartPointer< Option > &option)
 Calculates Vega using backward differencing scheme. More...
 

Private Attributes

double h_
 Increment used in differencing scheme. More...
 
NumDiffScheme scheme_
 Scheme used in differencing. More...
 
std::string risk_name_
 Risk name that will be used as key for result map. Default name is Vega. More...
 

Detailed Description

Calculates option's vega.

This method calculates Vega. Using the method prize of julian::PricingEngine and bumpVolatility of julian::MarketModel it calculates the option sensitivity to asset volatility. Vega of option is can be calculated using the finite difference scheme

  • $Vega = \frac{\partial PV}{\partial Vol} \approx \frac{PV(Vol+h) - PV(Vol)}{h}$ when forward differencing is used
  • $Vega = \frac{\partial PV}{\partial Vol} \approx \frac{PV(Vol) - PV(Vol-h)}{h}$ when backward differencing is used
  • $Vega = \frac{\partial PV}{\partial Vol} \approx \frac{PV(Vol+h) - PV(Vol-h)}{2h}$ when central differencing is used

The result is saved in map. OptionVega is a concrete decorator in decorator structure. Concrete Decorator is a class that altered alters the behaviour of Concrete Component.

Constructor & Destructor Documentation

julian::OptionVega::OptionVega ( SmartPointer< OptionGreeks input,
double  h,
NumDiffScheme  scheme,
std::string  risk_name = "Vega" 
)
inline

Constructor.

Member Function Documentation

void julian::OptionVega::BwdVega ( GreeksIntermediateResults rr,
const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
private

Calculates Vega using backward differencing scheme.

Method checks if the PV for a given market shifts were calculated. If yes, it uses them in estimating the Vega. If they were not calculated, it performs calculations, saves them and then calculates Vega.

GreeksIntermediateResults julian::OptionVega::calculateRisks ( const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
virtual

calculates the option's Vega

Vega of option is calculated using the finite difference scheme

  • $Vega = \frac{\partial PV}{\partial Vol} \approx \frac{PV(Vol+h) - PV(Vol)}{h}$ when forward differencing is used
  • $Vega = \frac{\partial PV}{\partial Vol} \approx \frac{PV(Vol) - PV(Vol-h)}{h}$ when backward differencing is used
  • $Vega = \frac{\partial PV}{\partial Vol} \approx \frac{PV(Vol+h) - PV(Vol-h)}{2h}$ when central differencing is used
Returns
method returns map with key "Vega" and value of Vega

Reimplemented from julian::OptionGreeksDecorator.

OptionVega * julian::OptionVega::clone ( ) const
virtual

virtual copy constructor

Reimplemented from julian::OptionGreeksDecorator.

void julian::OptionVega::CntrVega ( GreeksIntermediateResults rr,
const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
private

Calculates Vega using central differencing scheme.

Method checks if the PV for a given market shifts were calculated. If yes, it uses them in estimating the Vega. If they were not calculated, it performs calculations, saves them and then calculates Vega.

void julian::OptionVega::FwdVega ( GreeksIntermediateResults rr,
const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
private

Calculates Vega using forward differencing scheme.

Method checks if the PV for a given market shifts were calculated. If yes, it uses them in estimating the Vega. If they were not calculated, it performs calculations, saves them and then calculates Vega.

std::map< std::string, double > julian::OptionVega::getRisks ( const SmartPointer< MarketModel > &  model,
const SmartPointer< PricingEngine > &  prizer,
const SmartPointer< Option > &  option 
)
virtual

returns the PV and Greek parameter

Returns
method returns map with name of Greeks as key and the value of Greeks as value

Reimplemented from julian::OptionGreeksDecorator.

Member Data Documentation

double julian::OptionVega::h_
private

Increment used in differencing scheme.

std::string julian::OptionVega::risk_name_
private

Risk name that will be used as key for result map. Default name is Vega.

NumDiffScheme julian::OptionVega::scheme_
private

Scheme used in differencing.


The documentation for this class was generated from the following files:
  • C:/Unix/home/OEM/jULIAN/src/pricingEngines/optionGreeks/optionVega.hpp
  • C:/Unix/home/OEM/jULIAN/src/pricingEngines/optionGreeks/optionVega.cpp