|
From: Luigi B. <lui...@gm...> - 2024-06-20 08:43:29
|
Hello,
no, InterpolatedDiscountCurve doesn't change with respect to the
evaluation date. That's why it's built by explicitly specifying discount
factors at given dates. If I build a curve saying, for instance,
vector<Date> dates = { Date(20, Jun, 2024), Date(29, Jul, 2024),
Date(31, Aug, 2024), Date(30, Sep, 2024) };
vector<DiscountFactor> dfs = { 1.0000, 0.9999, 0.9993, 0.9988 };
auto curve = InterpolatedDiscountCurve<LogLinear> >(dates, dfs,
Actual365Fixed());
that says that the discount on September 30th 2024 is 0.9988, should the
discount for that date change when we move the evaluation date? And if it
should change, how do we move the dates so that the discount changes? Do
we shift them like we shifted the evaluation date? We might not have that
information, we only get notified that the evaluation date changed.
Currently, we sidestep the whole problem by keeping the curve as it was
specified regardless of the evaluation date.
Regards,
Luigi
On Thu, Jun 20, 2024 at 9:33 AM Wei Li <ttl...@gm...> wrote:
> Dear all,
>
> We are constructing yield curves using bootstrapped date and discount
> factor pairs, i.e., we use the InterpolatedDiscountCurve class. But when I
> am looking at the PUBLIC constructors of this class (all three of them take
> a date vector and a discount factor vector as basic form), I see that they
> all internally call the base class (YieldTermStructure) constructor using
> the first date in the vector (dates.at(0)) as an explicitly-passed
> reference date. It means this class doesn't register with the change of
> QuantLib's evaluation date.
>
> So when I am using these curves like this:
>
> Date delivery = Date (30, September, 2024);
> DiscountFactor df1 = my_curve -> discount(delivery);
>
> Date originalEvalDate = Settings::instance().evaluationDate();
> Settings::instance().evaluationDate() = originalEvalDate + 30;
>
> DiscountFactor df2 = my_curve -> discount(delivery);
>
> I would expect the df2 to be different from df1, but it is not the case.
> Since the reference date of my_curve never got changed, the
> timeFromReference remained the same and hence the discount factor.
>
> Is there some way to construct a discount curve using dates and dfs, and
> the curve would reflect the change of evaluation date, or am I totally
> wrong to expect it would?
>
> Cheers,
> Wei
>
> _______________________________________________
> QuantLib-users mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>
|