Calibrated model class with linkable parameters.
More...
#include <qle/models/linkablecalibratedmodel.hpp>
|
| LinkableCalibratedModel () |
|
void | update () override |
|
virtual void | calibrate (const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > &, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >(), const std::vector< bool > &fixParameters=std::vector< bool >()) |
| Calibrate to a set of market instruments (usually caps/swaptions) More...
|
|
virtual void | calibrate (const std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > &, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >(), const std::vector< bool > &fixParameters=std::vector< bool >()) |
| for backward compatibility More...
|
|
Real | value (const Array ¶ms, const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > &) |
|
Real | value (const Array ¶ms, const std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > &) |
| for backward compatibility More...
|
|
const QuantLib::ext::shared_ptr< Constraint > & | constraint () const |
|
EndCriteria::Type | endCriteria () const |
| Returns end criteria result. More...
|
|
const Array & | problemValues () const |
| Returns the problem values. More...
|
|
Array | params () const |
| Returns array of arguments on which calibration is done. More...
|
|
virtual void | setParams (const Array ¶ms) |
|
virtual void | setParam (Size idx, const Real value) |
|
Calibrated model class with linkable parameters.
Definition at line 40 of file linkablecalibratedmodel.hpp.
◆ LinkableCalibratedModel()
Definition at line 30 of file linkablecalibratedmodel.cpp.
std::vector< QuantLib::ext::shared_ptr< Parameter > > arguments_
QuantLib::ext::shared_ptr< Constraint > constraint_
EndCriteria::Type endCriteria_
◆ update()
◆ calibrate() [1/2]
virtual void calibrate |
( |
const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > & |
, |
|
|
OptimizationMethod & |
method, |
|
|
const EndCriteria & |
endCriteria, |
|
|
const Constraint & |
constraint = Constraint() , |
|
|
const std::vector< Real > & |
weights = std::vector< Real >() , |
|
|
const std::vector< bool > & |
fixParameters = std::vector< bool >() |
|
) |
| |
|
virtual |
Calibrate to a set of market instruments (usually caps/swaptions)
An additional constraint can be passed which must be satisfied in addition to the constraints of the model.
◆ calibrate() [2/2]
for backward compatibility
◆ value() [1/2]
Real value |
( |
const Array & |
params, |
|
|
const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > & |
|
|
) |
| |
◆ value() [2/2]
Real value |
( |
const Array & |
params, |
|
|
const std::vector< QuantLib::ext::shared_ptr< BlackCalibrationHelper > > & |
instruments |
|
) |
| |
for backward compatibility
Definition at line 109 of file linkablecalibratedmodel.cpp.
110 {
111 vector<ext::shared_ptr<CalibrationHelper> > tmp(instruments.size());
112 for (Size i = 0; i < instruments.size(); ++i)
113 tmp[i] = ext::static_pointer_cast<CalibrationHelper>(instruments[i]);
115}
Array params() const
Returns array of arguments on which calibration is done.
Real value(const Array ¶ms, const std::vector< QuantLib::ext::shared_ptr< CalibrationHelper > > &)
◆ constraint()
const QuantLib::ext::shared_ptr< Constraint > & constraint |
( |
| ) |
const |
◆ endCriteria()
EndCriteria::Type endCriteria |
( |
| ) |
const |
◆ problemValues()
const Array & problemValues |
( |
| ) |
const |
◆ params()
Returns array of arguments on which calibration is done.
Definition at line 124 of file linkablecalibratedmodel.cpp.
124 {
125 Size size = 0, i;
129 Size k = 0;
131 for (Size j = 0; j <
arguments_[i]->size(); j++, k++) {
133 }
134 }
136}
◆ setParams()
void setParams |
( |
const Array & |
params | ) |
|
|
virtual |
Definition at line 138 of file linkablecalibratedmodel.cpp.
138 {
139 Array::const_iterator p =
params.begin();
140 for (Size i = 0; i <
arguments_.size(); ++i) {
141 for (Size j = 0; j <
arguments_[i]->size(); ++j, ++p) {
142 QL_REQUIRE(p !=
params.end(),
"parameter array too small");
144 }
145 }
146 QL_REQUIRE(p ==
params.end(),
"parameter array too big!");
148 notifyObservers();
149}
◆ setParam()
void setParam |
( |
Size |
idx, |
|
|
const Real |
value |
|
) |
| |
|
virtual |
Definition at line 151 of file linkablecalibratedmodel.cpp.
151 {
152 int tmp = static_cast<int>(idx);
153 for (Size i = 0; i <
arguments_.size(); ++i) {
154 for (Size j = 0; j <
arguments_[i]->size(); ++j) {
155 if (tmp-- == 0)
157 }
158 }
160 notifyObservers();
161}
◆ generateArguments()
virtual void generateArguments |
( |
| ) |
|
|
protectedvirtual |
◆ CalibrationFunction
friend class CalibrationFunction |
|
friend |
◆ arguments_
std::vector<QuantLib::ext::shared_ptr<Parameter> > arguments_ |
|
protected |
◆ constraint_
◆ endCriteria_
EndCriteria::Type endCriteria_ |
|
protected |
◆ problemValues_