24#include <ql/currencies/america.hpp>
25#include <ql/termstructures/credit/flathazardrate.hpp>
35 const std::string& configuration)
36 : market_(market), configuration_(configuration), data_(
data) {
39 LOG(
"LgmCalibration for name " <<
name <<
", configuration is " << configuration);
43 QL_REQUIRE(!
data_->calibrateA() && !
data_->calibrateH(),
"CrLgmBuilder does not support calibration currently");
48 Array aTimes(
data_->aTimes().begin(),
data_->aTimes().end());
49 Array hTimes(
data_->hTimes().begin(),
data_->hTimes().end());
50 Array alpha(
data_->aValues().begin(),
data_->aValues().end());
51 Array h(
data_->hValues().begin(),
data_->hValues().end());
55 QuantLib::ext::make_shared<QuantExt::CrLgm1fConstantParametrization>(USDCurrency(),
modelDefaultCurve_, alpha[0], h[0],
name);
57 LOG(
"Apply shift horizon and scale");
59 QL_REQUIRE(
data_->shiftHorizon() >= 0.0,
"shift horizon must be non negative");
60 QL_REQUIRE(
data_->scaling() > 0.0,
"scaling must be positive");
62 if (
data_->shiftHorizon() > 0.0) {
63 LOG(
"Apply shift horizon " <<
data_->shiftHorizon() <<
" to the " <<
data_->qualifier() <<
" CR-LGM model");
67 if (
data_->scaling() != 1.0) {
68 LOG(
"Apply scaling " <<
data_->scaling() <<
" to the " <<
data_->qualifier() <<
" CR-LGM model");
RelinkableHandle< DefaultProbabilityTermStructure > modelDefaultCurve_
CrLgmBuilder(const QuantLib::ext::shared_ptr< ore::data::Market > &market, const QuantLib::ext::shared_ptr< CrLgmData > &data, const std::string &configuration=Market::defaultConfiguration)
QuantLib::ext::shared_ptr< ore::data::Market > market_
QuantLib::ext::shared_ptr< CrLgmData > data_
QuantLib::ext::shared_ptr< QuantExt::CrLgm1fParametrization > parametrization_
Classes and functions for log message handling.
#define LOG(text)
Logging Macro (Level = Notice)
Serializable Credit Default Swap.