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

MCEngine Class Reference

#include <MCEngine.h>

List of all members.

Public Member Functions

 MCEngine (LongNatural nPaths, LongNatural nDates, valarray< Real > DiscFactors)
 Default constructor.

 ~MCEngine ()
 MCEngine (void)
 Default constructor.

 MCEngine (LongNatural nPaths, Real DFToMaturity)
 for 1 date (non path dependant payOffs)

void RunEngineRainbow2SpreadOptionMax (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation, Real Mult)
 Price Spread option with 2 assets.

void RunEngineRainbow2AssetsBasketMax (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation, Real Mult)
 Price basker option with 2 assets.

void RunEngineRainbowBestOf2AssetsCash (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation)
 Price best of + cash option with 2 assets.

void RunEngineRainbowWorstOf2AssetsCash (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation)
 Price worst of + cash option with 2 assets.

void RunEngineRainbowMax2AssetsCall (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation, Real Mult)
 Price max call option with 2 assets.

void RunEngineRainbowMin2AssetsCall (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation, Real Mult)
 Price min call option with 2 assets.

void RunEngineRainbowMax2AssetsPut (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation, Real Mult)
 Price max put option with 2 assets.

void RunEngineRainbowMin2AssetsPut (Random *pRandom, valarray< GaussianProcess > pHazardRateProcesses, PayOff thePayOff, Real gaussianSample, valarray< Real > TerminalPoints, valarray< Real > weights, Matrix Correlation, Real Mult)
 Price min put option with 2 assets.

void RunEngineAsianCall (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price Asian Call.

void RunEngineAsianPut (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price Asian Put.

void RunEngineCall (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price European standard Call.

void RunEnginePut (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price uropean standard Put.

void RunEngineRevLookbackCall (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price Lokback Call.

void RunEngineRevLookbackPut (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price Lokback Put.

void RunEngineBarrierCall (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price Barrier Call.

void RunEngineBarrierPut (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price Barrier Put.

void RunEngineFlooredCliquet (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price FlooredCliquet.

void RunEngineCappedCliquet (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath)
 Price CappedCliquet.

void RunEngineGeneral (Random *pRandom, GaussianProcess *pHazardRateProcess, PayOff thePayOff, valarray< Real > gaussianSample, valarray< Real > vHazardRatePath, Natural Product)
 Run Monte Carlo Engine with code for the product.

Real MCResult ()
 Return result of Monte carlo simulation.


Private Attributes

Real m_price
Real m_DiscFactor
LongNatural m_nPaths
LongNatural m_nDates


Constructor & Destructor Documentation

MCEngine::MCEngine (  LongNatural  nPaths,
LongNatural  nDates,
valarray< Real >  DiscFactors
) 
 

Default constructor.

Parameters:
price: Start Date of the drift
nPaths: Length of the drift to be computed
nDates: Number of dates to cut the drift
Vol: Yield Curve to compute the spot rate between each date
Spot: Volatility Surface to compute the forward volatility between each date
Strike: Strike of the option, used to compute the colatility (function of the strike)

Definition at line 3 of file MCEngine.cpp.

References LongNatural, m_DiscFactor, and m_price.

MCEngine::~MCEngine (   ) 
 

Definition at line 20 of file MCEngine.cpp.

MCEngine::MCEngine (  void   ) 
 

Default constructor.

Author:
Yann

Definition at line 24 of file MCEngine.cpp.

MCEngine::MCEngine (  LongNatural  nPaths,
Real  DFToMaturity
) 
 

for 1 date (non path dependant payOffs)

Author:
Yann
Parameters:
nPaths: to compute the MC
DFToMaturity: 1 date so only one Df needed

Definition at line 11 of file MCEngine.cpp.

References LongNatural, m_price, and Real.


Member Function Documentation

Real MCEngine::MCResult (   ) 
 

Return result of Monte carlo simulation.

Definition at line 353 of file MCEngine.cpp.

References m_nPaths, m_price, and Real.

Referenced by mainmc(), RainbowOption::PriceByMc_2AssetsBasketMax(), RainbowOption::PriceByMc_2SpreadOptionMax(), RainbowOption::PriceByMc_BestOf2AssetsCash(), RainbowOption::PriceByMc_Max2AssetsCall(), RainbowOption::PriceByMc_Max2AssetsPut(), RainbowOption::PriceByMc_Min2AssetsCall(), RainbowOption::PriceByMc_Min2AssetsPut(), and RainbowOption::PriceByMc_WorstOf2AssetsCash().

void MCEngine::RunEngineAsianCall (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price Asian Call.

Definition at line 213 of file MCEngine.cpp.

References PayOff::AsianCall(), GaussianProcess::BuildPath(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, and m_price.

Referenced by RunEngineGeneral().

void MCEngine::RunEngineAsianPut (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price Asian Put.

Definition at line 224 of file MCEngine.cpp.

References PayOff::AsianPut(), GaussianProcess::BuildPath(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, and m_price.

Referenced by RunEngineGeneral().

void MCEngine::RunEngineBarrierCall (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price Barrier Call.

Definition at line 285 of file MCEngine.cpp.

References PayOff::BarrierCall(), GaussianProcess::BuildPath(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, and m_price.

Referenced by RunEngineGeneral().

void MCEngine::RunEngineBarrierPut (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price Barrier Put.

Definition at line 296 of file MCEngine.cpp.

References PayOff::BarrierPut(), GaussianProcess::BuildPath(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, and m_price.

Referenced by RunEngineGeneral().

void MCEngine::RunEngineCall (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price European standard Call.

Definition at line 235 of file MCEngine.cpp.

References GaussianProcess::BuildPath(), PayOff::Call(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, and m_price.

Referenced by RunEngineGeneral().

void MCEngine::RunEngineCappedCliquet (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price CappedCliquet.

Definition at line 318 of file MCEngine.cpp.

References GaussianProcess::BuildPath(), PayOff::CappedCliquet(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, and m_price.

Referenced by RunEngineGeneral().

void MCEngine::RunEngineFlooredCliquet (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price FlooredCliquet.

Definition at line 307 of file MCEngine.cpp.

References GaussianProcess::BuildPath(), PayOff::FlooredCliquet(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, and m_price.

Referenced by RunEngineGeneral().

void MCEngine::RunEngineGeneral (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath,
Natural  Product
) 
 

Run Monte Carlo Engine with code for the product.

Definition at line 329 of file MCEngine.cpp.

References Natural, RunEngineAsianCall(), RunEngineAsianPut(), RunEngineBarrierCall(), RunEngineBarrierPut(), RunEngineCall(), RunEngineCappedCliquet(), RunEngineFlooredCliquet(), RunEnginePut(), RunEngineRevLookbackCall(), and RunEngineRevLookbackPut().

Referenced by mainmc().

void MCEngine::RunEnginePut (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price uropean standard Put.

Definition at line 252 of file MCEngine.cpp.

References GaussianProcess::BuildPath(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, m_price, and PayOff::Put().

Referenced by RunEngineGeneral().

void MCEngine::RunEngineRainbow2AssetsBasketMax (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation,
Real  Mult
) 
 

Price basker option with 2 assets.

Definition at line 51 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::Rainbow2AssetsBasketMax(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_2AssetsBasketMax().

void MCEngine::RunEngineRainbow2SpreadOptionMax (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation,
Real  Mult
) 
 

Price Spread option with 2 assets.

Definition at line 28 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::Rainbow2SpreadOptionMax(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_2SpreadOptionMax().

void MCEngine::RunEngineRainbowBestOf2AssetsCash (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation
) 
 

Price best of + cash option with 2 assets.

Definition at line 75 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::RainbowBestOf2AssetsCash(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_BestOf2AssetsCash().

void MCEngine::RunEngineRainbowMax2AssetsCall (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation,
Real  Mult
) 
 

Price max call option with 2 assets.

Definition at line 121 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::RainbowMax2AssetsCall(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_Max2AssetsCall().

void MCEngine::RunEngineRainbowMax2AssetsPut (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation,
Real  Mult
) 
 

Price max put option with 2 assets.

Definition at line 167 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::RainbowMax2AssetsPut(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_Max2AssetsPut().

void MCEngine::RunEngineRainbowMin2AssetsCall (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation,
Real  Mult
) 
 

Price min call option with 2 assets.

Definition at line 144 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::RainbowMin2AssetsCall(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_Min2AssetsCall().

void MCEngine::RunEngineRainbowMin2AssetsPut (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation,
Real  Mult
) 
 

Price min put option with 2 assets.

Definition at line 190 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::RainbowMin2AssetsPut(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_Min2AssetsPut().

void MCEngine::RunEngineRainbowWorstOf2AssetsCash (  Random *  pRandom,
valarray< GaussianProcess >  pHazardRateProcesses,
PayOff  thePayOff,
Real  gaussianSample,
valarray< Real >  TerminalPoints,
valarray< Real >  weights,
Matrix  Correlation
) 
 

Price worst of + cash option with 2 assets.

Definition at line 98 of file MCEngine.cpp.

References Matrix::CholeskyDecomposition(), Random::GetGaussian(), Matrix::GetRows(), LongNatural, m_DiscFactor, m_nPaths, m_price, Natural, PayOff::RainbowWorstOf2AssetsCash(), Real, and Matrix::SetValue().

Referenced by RainbowOption::PriceByMc_WorstOf2AssetsCash().

void MCEngine::RunEngineRevLookbackCall (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price Lokback Call.

Definition at line 263 of file MCEngine.cpp.

References GaussianProcess::BuildPath(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, m_price, and PayOff::RevLookbackCall().

Referenced by RunEngineGeneral().

void MCEngine::RunEngineRevLookbackPut (  Random *  pRandom,
GaussianProcess *  pHazardRateProcess,
PayOff  thePayOff,
valarray< Real >  gaussianSample,
valarray< Real >  vHazardRatePath
) 
 

Price Lokback Put.

Definition at line 274 of file MCEngine.cpp.

References GaussianProcess::BuildPath(), Random::GetGaussians(), LongNatural, m_DiscFactor, m_nPaths, m_price, and PayOff::RevLookbackPut().

Referenced by RunEngineGeneral().


Member Data Documentation

Real MCEngine::m_DiscFactor [private]
 

Definition at line 99 of file MCEngine.h.

Referenced by MCEngine(), RunEngineAsianCall(), RunEngineAsianPut(), RunEngineBarrierCall(), RunEngineBarrierPut(), RunEngineCall(), RunEngineCappedCliquet(), RunEngineFlooredCliquet(), RunEnginePut(), RunEngineRainbow2AssetsBasketMax(), RunEngineRainbow2SpreadOptionMax(), RunEngineRainbowBestOf2AssetsCash(), RunEngineRainbowMax2AssetsCall(), RunEngineRainbowMax2AssetsPut(), RunEngineRainbowMin2AssetsCall(), RunEngineRainbowMin2AssetsPut(), RunEngineRainbowWorstOf2AssetsCash(), RunEngineRevLookbackCall(), and RunEngineRevLookbackPut().

LongNatural MCEngine::m_nDates [private]
 

Definition at line 101 of file MCEngine.h.

LongNatural MCEngine::m_nPaths [private]
 

Definition at line 100 of file MCEngine.h.

Referenced by MCResult(), RunEngineAsianCall(), RunEngineAsianPut(), RunEngineBarrierCall(), RunEngineBarrierPut(), RunEngineCall(), RunEngineCappedCliquet(), RunEngineFlooredCliquet(), RunEnginePut(), RunEngineRainbow2AssetsBasketMax(), RunEngineRainbow2SpreadOptionMax(), RunEngineRainbowBestOf2AssetsCash(), RunEngineRainbowMax2AssetsCall(), RunEngineRainbowMax2AssetsPut(), RunEngineRainbowMin2AssetsCall(), RunEngineRainbowMin2AssetsPut(), RunEngineRainbowWorstOf2AssetsCash(), RunEngineRevLookbackCall(), and RunEngineRevLookbackPut().

Real MCEngine::m_price [private]
 

Definition at line 99 of file MCEngine.h.

Referenced by MCEngine(), MCResult(), RunEngineAsianCall(), RunEngineAsianPut(), RunEngineBarrierCall(), RunEngineBarrierPut(), RunEngineCall(), RunEngineCappedCliquet(), RunEngineFlooredCliquet(), RunEnginePut(), RunEngineRainbow2AssetsBasketMax(), RunEngineRainbow2SpreadOptionMax(), RunEngineRainbowBestOf2AssetsCash(), RunEngineRainbowMax2AssetsCall(), RunEngineRainbowMax2AssetsPut(), RunEngineRainbowMin2AssetsCall(), RunEngineRainbowMin2AssetsPut(), RunEngineRainbowWorstOf2AssetsCash(), RunEngineRevLookbackCall(), and RunEngineRevLookbackPut().


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:39 2005 for terreneuve by doxygen 1.3.6