Posted by
Luigi Ballabio on
URL: http://quantlib.414.s1.nabble.com/Adjust-dates-of-term-structure-tp7330p7331.html
Hi Matt,
apologies for the late answer.
You have a couple of possibilities. One is to extract the rates from
the bootstrapped curve via the nodes() method (which returns a list of
(date,rate) pairs) and use them to build an interpolated forward
curve. In Python, that would be a ForwardCurve instance; its
constructor takes a vector of dates and a vector of corresponding
rates.
Depending on what you want to do, another possibility is to leave the
reference date of the curve free to move. For that, you can use the
PiecewiseFlatForward constructor that takes settlementDays and
calendar instead of a reference date; for instance,
PiecewiseFlatForward(0,TARGET(),helpers,day_counter) will give you a
curve whose reference date follows the evaluation date. When you
bootstrap it with Settings.instance().evaluationDate set to today's
date, you'll get your original curve. If you set
Settings.instance().evaluationDate to a different date, the curve will
perform the bootstrap again based on the new evaluation date (note,
though, that this will build you a curve that gives you the same
deposit and swap rates, but possibly not the very same forward rates).
Hope this helps,
Luigi
On Mon, Oct 22, 2012 at 10:24 PM, mattgline <
[hidden email]> wrote:
>
> Hello,
>
> I am a brand new quantlib developer, using the python bindings via SWIG.
>
> I am trying to take a YieldTermStructure (actually, a PieceswiseFlatForward)
> and roll it forward or update the dates - eg, given a PiecewiseFlatForward
> constructed with a certain reference date, I'd like to construct a new
> PiecewiseFlatForward with the same rates starting on a different date.
>
> Is it possible to modify the dates associated with these objects?
>
> Thanks to all,
>
> --Matt
> --
> View this message in context:
http://old.nabble.com/Adjust-dates-of-term-structure--tp34588749p34588749.html> Sent from the quantlib-users mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
>
http://p.sf.net/sfu/appdyn_sfd2d_oct> _______________________________________________
> QuantLib-users mailing list
>
[hidden email]
>
https://lists.sourceforge.net/lists/listinfo/quantlib-users------------------------------------------------------------------------------
LogMeIn Central: Instant, anywhere, Remote PC access and management.
Stay in control, update software, and manage PCs from one command center
Diagnose problems and improve visibility into emerging IT issues
Automate, monitor and manage. Do more in less time with Central
http://p.sf.net/sfu/logmein12331_d2d_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users