#include <MCEngine.h>
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 |
|
Default constructor.
Definition at line 3 of file MCEngine.cpp. References LongNatural, m_DiscFactor, and m_price. |
|
Definition at line 20 of file MCEngine.cpp. |
|
Default constructor.
Definition at line 24 of file MCEngine.cpp. |
|
for 1 date (non path dependant payOffs)
Definition at line 11 of file MCEngine.cpp. References LongNatural, m_price, and Real. |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
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(). |
|
|
Definition at line 101 of file MCEngine.h. |
|
|