Posted by
japari on
URL: http://quantlib.414.s1.nabble.com/Hazard-Rates-Interpolator-QLXL-tp16657p16811.html
Hi,
The proper way to do it is what you imply; A factory linked to a tag to resolve the template parameter. I haven’t done that and resolve it in the code, but its true I could have compared in a case independent way......
from QuantLibAddin/qlo/credit.cpp #256:
PiecewiseHazardRateCurve::PiecewiseHazardRateCurve(
const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
const std::vector<boost::shared_ptr<QuantLib::DefaultProbabilityHelper> >& helpers,
const QuantLib::DayCounter& dayCounter,
const QuantLib::Calendar& calendar,
const std::string& interpolator,
QuantLib::Real accuracy,
bool permanent)
: DefaultProbabilityTermStructure(properties, permanent) {
if(interpolator == std::string("LINEAR")){
libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
QuantLib::PiecewiseDefaultCurve<QuantLib::HazardRate,
QuantLib::Linear>(
0,
calendar,
helpers,
dayCounter));
}else if(interpolator == std::string("BACKWARDFLAT")) {
libraryObject_ = boost::shared_ptr<QuantLib::Extrapolator>(new
QuantLib::PiecewiseDefaultCurve<QuantLib::HazardRate,
QuantLib::BackwardFlat>(
0,
calendar,
helpers,
dayCounter));
}else{
QL_FAIL("Unrecognised interpolator");
}
libraryObject_->enableExtrapolation();
}
Best
Pepe
----- Original Message -----
> Pepe, I seem to remember that those string tags in QLXL are case
> insensitive in general (stop me if I am talking nonsense), so maybe
> this should apply to the credit part as well ? Also, is there a
> complete list of allowed tags (except in the enumerated something
> files themselves ?) - I guess it would be nice to have them available
> in one place in some public doc ?
> Peter
>
> On 18 August 2015 at 21:57, <
[hidden email]> wrote:
> > Au passage; there are a few worksheets in
> >
> > QuantLibXL/StandaloneExamples/Credit
> > QuantLibXL/StandaloneExamples/CreditPortfolioRisk
> >
> > that show how to call the credit functionality.
> >
> > Best
> > Pepe
> >
> >
> > ----- Original Message -----
> >>
> >>
> >>
> >> Hello, sorry for a late reply,
> >>
> >>
> >> indeed with upper case works perfect :) Thanks a lot!
> >>
> >>
> >> Kind regards,
> >> Lyuba
> >>
> >>
> >> 2015-06-23 10:28 GMT+02:00 <
[hidden email] > :
> >>
> >>
> >> Hello, sorry I did not see this one before.
> >>
> >> Yes, it expects a text string for selecting the constructor. Can
> >> you
> >> check the case please?, it has to be upper case. "BACKWARDFLAT"
> >> If that gives trouble, can you send a simple wsheet so I can debug
> >> it
> >> pls?
> >> Best
> >> pp
> >>
> >>
> >>
> >>
> >> ----- Original Message -----
> >> >
> >> >
> >> >
> >> > Hi everyone
> >> >
> >> >
> >> > i had a question regarding interpolator for hazard rates
> >> > bootstrapping in qlxl. I use qlPiecewiseHazardRateCurve function
> >> > and
> >> > tried to pass interpolator as string ("BackwardFlat") as well as
> >> > id
> >> > of interpolator object created using qlInterpolation function.
> >> > In
> >> > both cases I get a failure message "Unrecognized interpolator".
> >> > In
> >> > which format should I pass the interpolation method?
> >> >
> >> >
> >> > Many thanks
> >> > Lyuba
> >> > ------------------------------------------------------------------------------
> >> >
> >> > _______________________________________________
> >> > QuantLib-users mailing list
> >> >
[hidden email]
> >> >
https://lists.sourceforge.net/lists/listinfo/quantlib-users> >> >
> >>
> >>
> >> ------------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> QuantLib-users mailing list
> >>
[hidden email]
> >>
https://lists.sourceforge.net/lists/listinfo/quantlib-users> >>
> >
> > ------------------------------------------------------------------------------
> > _______________________________________________
> > QuantLib-users mailing list
> >
[hidden email]
> >
https://lists.sourceforge.net/lists/listinfo/quantlib-users>
------------------------------------------------------------------------------
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users