QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
|
#include <ql/methods/finitedifferences/utilities/localvolrndcalculator.hpp>
Public Member Functions | |
LocalVolRNDCalculator (ext::shared_ptr< Quote > spot, ext::shared_ptr< YieldTermStructure > rTS, ext::shared_ptr< YieldTermStructure > qTS, const ext::shared_ptr< LocalVolTermStructure > &localVol, Size xGrid=101, Size tGrid=51, Real x0Density=0.1, Real localVolProbEps=1e-6, Size maxIter=10000, Time gaussianStepSize=-Null< Time >()) | |
LocalVolRNDCalculator (ext::shared_ptr< Quote > spot, ext::shared_ptr< YieldTermStructure > rTS, ext::shared_ptr< YieldTermStructure > qTS, ext::shared_ptr< LocalVolTermStructure > localVol, const ext::shared_ptr< TimeGrid > &timeGrid, Size xGrid=101, Real x0Density=0.1, Real eps=1e-6, Size maxIter=10000, Time gaussianStepSize=-Null< Time >()) | |
Real | pdf (Real x, Time t) const override |
Real | cdf (Real x, Time t) const override |
Real | invcdf (Real p, Time t) const override |
ext::shared_ptr< TimeGrid > | timeGrid () const |
ext::shared_ptr< Fdm1dMesher > | mesher (Time t) const |
std::vector< Size > | rescaleTimeSteps () const |
Public Member Functions inherited from RiskNeutralDensityCalculator | |
virtual Real | pdf (Real x, Time t) const =0 |
virtual Real | cdf (Real x, Time t) const =0 |
virtual Real | invcdf (Real p, Time t) const =0 |
virtual | ~RiskNeutralDensityCalculator ()=default |
Public Member Functions inherited from LazyObject | |
LazyObject () | |
~LazyObject () override=default | |
void | update () override |
bool | isCalculated () const |
void | forwardFirstNotificationOnly () |
void | alwaysForwardNotifications () |
void | recalculate () |
void | freeze () |
void | unfreeze () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from Observer | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
Protected Member Functions | |
void | performCalculations () const override |
Protected Member Functions inherited from LazyObject | |
virtual void | calculate () const |
Private Member Functions | |
Real | probabilityInterpolation (Size idx, Real x) const |
Array | rescalePDF (const Array &x, const Array &p) const |
Private Attributes | |
const Size | xGrid_ |
const Size | tGrid_ |
const Real | x0Density_ |
const Real | localVolProbEps_ |
const Size | maxIter_ |
const Time | gaussianStepSize_ |
const ext::shared_ptr< Quote > | spot_ |
const ext::shared_ptr< LocalVolTermStructure > | localVol_ |
const ext::shared_ptr< YieldTermStructure > | rTS_ |
const ext::shared_ptr< YieldTermStructure > | qTS_ |
const ext::shared_ptr< TimeGrid > | timeGrid_ |
std::vector< ext::shared_ptr< Fdm1dMesher > > | xm_ |
const ext::shared_ptr< Matrix > | pm_ |
std::vector< Size > | rescaleTimeSteps_ |
std::vector< ext::shared_ptr< Interpolation > > | pFct_ |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Attributes inherited from LazyObject | |
bool | calculated_ = false |
bool | frozen_ = false |
bool | alwaysForward_ |
Definition at line 43 of file localvolrndcalculator.hpp.
LocalVolRNDCalculator | ( | ext::shared_ptr< Quote > | spot, |
ext::shared_ptr< YieldTermStructure > | rTS, | ||
ext::shared_ptr< YieldTermStructure > | qTS, | ||
const ext::shared_ptr< LocalVolTermStructure > & | localVol, | ||
Size | xGrid = 101 , |
||
Size | tGrid = 51 , |
||
Real | x0Density = 0.1 , |
||
Real | localVolProbEps = 1e-6 , |
||
Size | maxIter = 10000 , |
||
Time | gaussianStepSize = -Null<Time>() |
||
) |
LocalVolRNDCalculator | ( | ext::shared_ptr< Quote > | spot, |
ext::shared_ptr< YieldTermStructure > | rTS, | ||
ext::shared_ptr< YieldTermStructure > | qTS, | ||
ext::shared_ptr< LocalVolTermStructure > | localVol, | ||
const ext::shared_ptr< TimeGrid > & | timeGrid, | ||
Size | xGrid = 101 , |
||
Real | x0Density = 0.1 , |
||
Real | eps = 1e-6 , |
||
Size | maxIter = 10000 , |
||
Time | gaussianStepSize = -Null<Time>() |
||
) |
Implements RiskNeutralDensityCalculator.
Definition at line 85 of file localvolrndcalculator.cpp.
Implements RiskNeutralDensityCalculator.
Definition at line 127 of file localvolrndcalculator.cpp.
Implements RiskNeutralDensityCalculator.
Definition at line 168 of file localvolrndcalculator.cpp.
ext::shared_ptr< TimeGrid > timeGrid | ( | ) | const |
Definition at line 212 of file localvolrndcalculator.cpp.
ext::shared_ptr< Fdm1dMesher > mesher | ( | Time | t | ) | const |
Definition at line 197 of file localvolrndcalculator.cpp.
std::vector< Size > rescaleTimeSteps | ( | ) | const |
Definition at line 334 of file localvolrndcalculator.cpp.
|
overrideprotectedvirtual |
This method must implement any calculations which must be (re)done in order to calculate the desired results.
Implements LazyObject.
Definition at line 216 of file localvolrndcalculator.cpp.
Definition at line 340 of file localvolrndcalculator.cpp.
Definition at line 351 of file localvolrndcalculator.cpp.
|
private |
Definition at line 84 of file localvolrndcalculator.hpp.
|
private |
Definition at line 84 of file localvolrndcalculator.hpp.
|
private |
Definition at line 85 of file localvolrndcalculator.hpp.
|
private |
Definition at line 86 of file localvolrndcalculator.hpp.
|
private |
Definition at line 87 of file localvolrndcalculator.hpp.
|
private |
Definition at line 88 of file localvolrndcalculator.hpp.
|
private |
Definition at line 89 of file localvolrndcalculator.hpp.
|
private |
Definition at line 90 of file localvolrndcalculator.hpp.
|
private |
Definition at line 91 of file localvolrndcalculator.hpp.
|
private |
Definition at line 92 of file localvolrndcalculator.hpp.
|
private |
Definition at line 93 of file localvolrndcalculator.hpp.
|
mutableprivate |
Definition at line 94 of file localvolrndcalculator.hpp.
|
private |
Definition at line 95 of file localvolrndcalculator.hpp.
|
mutableprivate |
Definition at line 96 of file localvolrndcalculator.hpp.
|
mutableprivate |
Definition at line 97 of file localvolrndcalculator.hpp.