本文整理汇总了C++中CurveData::buildCurve方法的典型用法代码示例。如果您正苦于以下问题:C++ CurveData::buildCurve方法的具体用法?C++ CurveData::buildCurve怎么用?C++ CurveData::buildCurve使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CurveData
的用法示例。
在下文中一共展示了CurveData::buildCurve方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
boost::shared_ptr<BlackCapFloorEngine> MustCapFloor::setEngineQuantLibBalckFT(){
CurveData cData;
// Fill out with some sample market data
cData.sampleMktData(cData);
// Build a curve linked to this market data
boost::shared_ptr<YieldTermStructure> ocurve = (cData.buildCurve(cData));
// Link the curve to the term structure
this->forwardingTermStructure.linkTo(ocurve);
//Date today(6, October, 2014);
Settings::instance().evaluationDate() = today;
//Date todaysDate = Date(8, Apr, 2015);
//capletsVolatilies = buildCurveOptionletAtmVol(cVol);
//capletsVolatilies = buildOptionletSurfaceVol(cVol);
//capletsVolatilies = buildOptionletCurveVol(cVol);
cVol.termStructure.linkTo(ocurve);
capletsVolatilies = (cVol.buildFlatCurveVol(cVol));
//capVol->enableExtrapolation();
return boost::shared_ptr<BlackCapFloorEngine>(new
BlackCapFloorEngine(forwardingTermStructure, capletsVolatilies));
}
示例2: LiborForwardModelProcess
boost::shared_ptr<AnalyticCapFloorEngine> MustCapFloor::setEngineQuantLibLMM(){
CurveData cData;
// Fill out with some sample market data
cData.sampleMktData(cData);
//Date today(10, October, 2014);
//Settings::instance().evaluationDate() = today;
// Build a curve linked to this market data
boost::shared_ptr<YieldTermStructure> ocurve = (cData.buildCurve(cData));
// Link the curve to the term structure
boost::shared_ptr<IborIndex> index = boost::shared_ptr<IborIndex>(new Euribor6M(forwardingTermStructure));
Date todaysDate =
myIndex->fixingCalendar().adjust(today);
Settings::instance().evaluationDate() = todaysDate;
this->forwardingTermStructure.linkTo(ocurve);
const Size size = floatingLeg.size();
boost::shared_ptr<LiborForwardModelProcess> process(
new LiborForwardModelProcess(size, myIndex));
//// set-up the model
///* const Real a = 0.02;
//const Real b = 0.12;
//const Real c = 0.1;
//const Real d = 0.01;*/
const Real a = 0.025;
const Real b = 0.12;
const Real c = 0.1;
const Real d = 0.01;
boost::shared_ptr<LmVolatilityModel> volaModel(
new LmLinearExponentialVolatilityModel(process->fixingTimes(), a, b, c, d));
boost::shared_ptr<LmCorrelationModel> corrModel(
new LmLinearExponentialCorrelationModel(size, 0.1, 0.1));
boost::shared_ptr<LiborForwardModel> liborModel(
new LiborForwardModel(process, volaModel, corrModel));
return boost::shared_ptr<AnalyticCapFloorEngine> (
new AnalyticCapFloorEngine(liborModel, forwardingTermStructure));
}