#include <qle/models/defaultableequityjumpdiffusionmodel.hpp>
|
| DefaultableEquityJumpDiffusionModelBuilder (const std::vector< Real > &stepTimes, const QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > &equity, const Handle< QuantLib::BlackVolTermStructure > &volatility, const Handle< QuantLib::DefaultProbabilityTermStructure > &creditCurve, const Real p=0.0, const Real eta=1.0, const bool staticMesher=false, const Size timeStepsPerYear=24, const Size stateGridPoints=100, const Real mesherEpsilon=1E-4, const Real mesherScaling=1.5, const Real mesherConcentration=Null< Real >(), const BootstrapMode mode=BootstrapMode::Alternating, const bool enforceFokkerPlanckBootstrap=false, const bool calibrate=true, const bool adjustEquityVolatility=true, const bool adjustEquityForward=true) |
|
Handle< DefaultableEquityJumpDiffusionModel > | model () const |
|
void | recalibrate () const |
| recalibrate model, if necessary More...
|
|
virtual void | forceRecalculate () |
| force recalibration of model More...
|
|
virtual bool | requiresRecalibration () const =0 |
| if false is returned, the model does not require a recalibration More...
|
|
◆ BootstrapMode
◆ DefaultableEquityJumpDiffusionModelBuilder()
DefaultableEquityJumpDiffusionModelBuilder |
( |
const std::vector< Real > & |
stepTimes, |
|
|
const QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > & |
equity, |
|
|
const Handle< QuantLib::BlackVolTermStructure > & |
volatility, |
|
|
const Handle< QuantLib::DefaultProbabilityTermStructure > & |
creditCurve, |
|
|
const Real |
p = 0.0 , |
|
|
const Real |
eta = 1.0 , |
|
|
const bool |
staticMesher = false , |
|
|
const Size |
timeStepsPerYear = 24 , |
|
|
const Size |
stateGridPoints = 100 , |
|
|
const Real |
mesherEpsilon = 1E-4 , |
|
|
const Real |
mesherScaling = 1.5 , |
|
|
const Real |
mesherConcentration = Null<Real>() , |
|
|
const BootstrapMode |
mode = BootstrapMode::Alternating , |
|
|
const bool |
enforceFokkerPlanckBootstrap = false , |
|
|
const bool |
calibrate = true , |
|
|
const bool |
adjustEquityVolatility = true , |
|
|
const bool |
adjustEquityForward = true |
|
) |
| |
Definition at line 37 of file defaultableequityjumpdiffusionmodel.cpp.
49
50
51
52 QL_REQUIRE(!stepTimes.empty(), "DefaultableEquityJumpDiffusionModel: at least one step time required");
54 "DefaultableEquityJumpDiffusionModel: for p != 0 (" <<
p_ <<
") adjustEquityVolatility must be true");
55
56
57
61
64
65
66 alwaysForwardNotifications();
67}
std::vector< Real > stepTimes_
Handle< BlackVolTermStructure > volatility_
bool adjustEquityForward_
Handle< DefaultProbabilityTermStructure > creditCurve_
Real mesherConcentration_
QuantLib::ext::shared_ptr< QuantExt::EquityIndex2 > equity_
bool enforceFokkerPlanckBootstrap_
QuantLib::ext::shared_ptr< MarketObserver > marketObserver_
bool adjustEquityVolatility_
BootstrapMode bootstrapMode_
Filter close_enough(const RandomVariable &x, const RandomVariable &y)
◆ model()
◆ forceRecalculate()
void forceRecalculate |
( |
| ) |
|
|
overridevirtual |
◆ requiresRecalibration()
bool requiresRecalibration |
( |
| ) |
const |
|
overridevirtual |
◆ performCalculations()
void performCalculations |
( |
| ) |
const |
|
overrideprivate |
Definition at line 123 of file defaultableequityjumpdiffusionmodel.cpp.
123 {
124
126
128
129
130
132
133
134
136 std::vector<Real> sigma(
stepTimes_.size(), 0.10);
137 model_.linkTo(QuantLib::ext::make_shared<DefaultableEquityJumpDiffusionModel>(
143 }
144
145
146 model_->notifyObservers();
147 }
148}
bool requiresRecalibration() const override
if false is returned, the model does not require a recalibration
◆ calibrationPointsChanged()
bool calibrationPointsChanged |
( |
const bool |
updateCache | ) |
const |
|
private |
Definition at line 84 of file defaultableequityjumpdiffusionmodel.cpp.
84 {
85
86
87
88 std::vector<Real> forwards;
89 std::vector<Real> variances;
91 forwards.push_back(
equity_->equitySpot()->value() *
equity_->equityDividendCurve()->discount(t) /
92 equity_->equityForecastCurve()->discount(t));
93 variances.push_back(
volatility_->blackVariance(t, forwards.back()));
94 }
95
96
97
98 bool changed = false;
100 changed = true;
101 } else {
102 for (Size i = 0; i <
stepTimes_.size() && !changed; ++i) {
103
105 changed = true;
107 changed = true;
108 }
109 }
110
111
112
113 if (updateCache) {
116 }
117
118
119
120 return changed;
121}
std::vector< Real > cachedForwards_
std::vector< Real > cachedVariances_
◆ stepTimes_
std::vector<Real> stepTimes_ |
|
private |
◆ equity_
◆ volatility_
◆ creditCurve_
Handle<DefaultProbabilityTermStructure> creditCurve_ |
|
private |
◆ p_
◆ eta_
◆ staticMesher_
◆ timeStepsPerYear_
◆ stateGridPoints_
◆ mesherEpsilon_
◆ mesherScaling_
◆ mesherConcentration_
Real mesherConcentration_ |
|
private |
◆ bootstrapMode_
◆ enforceFokkerPlanckBootstrap_
bool enforceFokkerPlanckBootstrap_ |
|
private |
◆ calibrate_
◆ adjustEquityVolatility_
bool adjustEquityVolatility_ |
|
private |
◆ adjustEquityForward_
bool adjustEquityForward_ |
|
private |
◆ forceCalibration_
bool forceCalibration_ = false |
|
private |
◆ marketObserver_
◆ cachedForwards_
std::vector<Real> cachedForwards_ |
|
mutableprivate |
◆ cachedVariances_
std::vector<Real> cachedVariances_ |
|
mutableprivate |
◆ model_