You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(23) |
| 2002 |
Jan
(18) |
Feb
(20) |
Mar
(22) |
Apr
(41) |
May
(28) |
Jun
(25) |
Jul
(10) |
Aug
(7) |
Sep
(5) |
Oct
(20) |
Nov
(13) |
Dec
(11) |
| 2003 |
Jan
(28) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(17) |
Jun
(6) |
Jul
(45) |
Aug
(35) |
Sep
(24) |
Oct
(50) |
Nov
(53) |
Dec
(6) |
| 2004 |
Jan
(4) |
Feb
(10) |
Mar
(52) |
Apr
(46) |
May
(8) |
Jun
(25) |
Jul
(12) |
Aug
(6) |
Sep
(8) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
| 2005 |
Jan
(18) |
Feb
(60) |
Mar
(19) |
Apr
(26) |
May
(14) |
Jun
(27) |
Jul
(8) |
Aug
(15) |
Sep
(19) |
Oct
(53) |
Nov
(20) |
Dec
(23) |
| 2006 |
Jan
(16) |
Feb
(27) |
Mar
(33) |
Apr
(51) |
May
(36) |
Jun
(25) |
Jul
(54) |
Aug
(30) |
Sep
(25) |
Oct
(67) |
Nov
(43) |
Dec
(13) |
| 2007 |
Jan
(23) |
Feb
(27) |
Mar
(55) |
Apr
(79) |
May
(60) |
Jun
(66) |
Jul
(46) |
Aug
(30) |
Sep
(90) |
Oct
(49) |
Nov
(85) |
Dec
(74) |
| 2008 |
Jan
(68) |
Feb
(59) |
Mar
(64) |
Apr
(28) |
May
(66) |
Jun
(35) |
Jul
(73) |
Aug
(76) |
Sep
(65) |
Oct
(46) |
Nov
(41) |
Dec
(19) |
| 2009 |
Jan
(46) |
Feb
(90) |
Mar
(51) |
Apr
(104) |
May
(13) |
Jun
(24) |
Jul
(20) |
Aug
(39) |
Sep
(109) |
Oct
(101) |
Nov
(117) |
Dec
(57) |
| 2010 |
Jan
(55) |
Feb
(42) |
Mar
(39) |
Apr
(22) |
May
(33) |
Jun
(41) |
Jul
(25) |
Aug
(52) |
Sep
(75) |
Oct
(60) |
Nov
(62) |
Dec
(52) |
| 2011 |
Jan
(70) |
Feb
(31) |
Mar
(26) |
Apr
(28) |
May
(17) |
Jun
(38) |
Jul
(51) |
Aug
(35) |
Sep
(27) |
Oct
(35) |
Nov
(10) |
Dec
(20) |
| 2012 |
Jan
(21) |
Feb
(29) |
Mar
(13) |
Apr
(37) |
May
(33) |
Jun
(12) |
Jul
(34) |
Aug
(27) |
Sep
(29) |
Oct
(35) |
Nov
(58) |
Dec
(27) |
| 2013 |
Jan
(27) |
Feb
(16) |
Mar
(40) |
Apr
(16) |
May
(34) |
Jun
(37) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(49) |
Nov
(13) |
Dec
(12) |
| 2014 |
Jan
(15) |
Feb
(21) |
Mar
(11) |
Apr
(13) |
May
(27) |
Jun
(60) |
Jul
(19) |
Aug
(29) |
Sep
(20) |
Oct
(28) |
Nov
(41) |
Dec
(15) |
| 2015 |
Jan
(33) |
Feb
(29) |
Mar
(26) |
Apr
(17) |
May
(2) |
Jun
(13) |
Jul
(21) |
Aug
(30) |
Sep
(22) |
Oct
(15) |
Nov
(46) |
Dec
(20) |
| 2016 |
Jan
(6) |
Feb
(5) |
Mar
(9) |
Apr
(15) |
May
(9) |
Jun
(4) |
Jul
(3) |
Aug
(4) |
Sep
(39) |
Oct
(8) |
Nov
(5) |
Dec
(8) |
| 2017 |
Jan
(4) |
Feb
(14) |
Mar
(4) |
Apr
(16) |
May
(5) |
Jun
(10) |
Jul
(25) |
Aug
(2) |
Sep
(5) |
Oct
(11) |
Nov
(8) |
Dec
(11) |
| 2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(1) |
May
(4) |
Jun
(21) |
Jul
(8) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(5) |
Mar
(18) |
Apr
(9) |
May
(5) |
Jun
(21) |
Jul
(25) |
Aug
(25) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(5) |
| 2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
|
| 2021 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(5) |
| 2022 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(14) |
Nov
|
Dec
(1) |
| 2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(2) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2024 |
Jan
(8) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
| 2025 |
Jan
(3) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2026 |
Jan
(1) |
Feb
(12) |
Mar
|
Apr
(2) |
May
(8) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Luigi B. <lui...@gm...> - 2014-02-01 15:47:11
|
Yes, possibly. In that case, we'd have to make the change in
InterpolatedForwardCurve<T>::zeroYieldImpl. But since we don't have
different exception types, we'd have to catch the exception and check
the error message it contains to decide whether to switch to the
base-class method (because if it's a different error, we'd want to let
it bubble up to client code). It wouldn't look very pretty :)
Another alternative would be to implement the numerical integration in
the LogLinear interpolation. I'm not sure that I like a situation in
which some curves are reasonably fast and others are much slower
depending on the interpolation method. Sure, the current situation is
that some interpolations don't work, so it might be an improvement
anyway...
(Oh, and a final note: while it makes sense to use log-linear with
discounts, because they're given by exp(-rt), I'm not sure that it
makes sense to use it with zero and forward rates.)
Luigi
On Tue, Jan 28, 2014 at 1:21 PM, Peter Caspers <pca...@gm...> wrote:
> Luigi, just out of curiosity, in ForwardRateStructure there seems to
> be a general purpose implementation to get the zero yield by
> integration over the forwards. Wouldn't the situation here be a use
> case for exactly this (i.e. catch the exception and invoke the base
> class method instead) ?
> best, Peter
>
> On 28 January 2014 12:37, Luigi Ballabio <lui...@gm...> wrote:
>> Yes. the curve is trying to integrate the forwards to get the
>> discounts, but the LogLinear interpolator doesn't provide a formula
>> for that. You'll have to choose another interpolation.
>>
>> Luigi
>>
>> On Mon, Jan 27, 2014 at 5:50 AM, varun yadav <var...@ya...> wrote:
>>> Hi Luigi,
>>>
>>> I passed evaluation date as the first date in liborDates. Also added
>>> corresponding rate in liborRates. But now it gives exception -
>>> "LogInterpolation primitive not implemented"
>>>
>>> Below are new values -
>>>
>>> liborDates -
>>>
>>> January 24th, 2014
>>> July 24th, 2014
>>> January 24th, 2015
>>> January 24th, 2016
>>> January 24th, 2017
>>> January 24th, 2018
>>> January 24th, 2019
>>> January 24th, 2020
>>> January 24th, 2021
>>> January 24th, 2022
>>> January 24th, 2023
>>> January 24th, 2024
>>> January 24th, 2029
>>>
>>> liborRates -
>>>
>>> 8.4
>>> 8.4955
>>> 8.36907
>>> 8.38416
>>> 8.47267
>>> 8.62786
>>> 8.69832
>>> 8.71107
>>> 8.85289
>>> 8.99607
>>> 8.80085
>>> 8.7099
>>> 9.00594
>>>
>>> Is exception coming due to InterpolatedForwardCurve<LogLinear> ...?
>>>
>>> Thanks in advance!
>>>
>>>
>>> On Thursday, January 23, 2014 5:02 PM, Luigi Ballabio
>>> <lui...@gm...> wrote:
>>> You should pass the evaluation date as the first date in liborDates.
>>> You'll need a corresponding extra element in liborRates; just
>>> replicate the first you have for constant rates from today to the
>>> first actual Libor date.
>>>
>>> Luigi
>>>
>>> On Mon, Jan 20, 2014 at 8:12 AM, v17 <var...@ya...> wrote:
>>>> Hi Everyone,
>>>>
>>>> I have following piece of code which gives Exception "negative time (-0.5)
>>>> given"
>>>>
>>>> vector <Real> &forwardRates;
>>>> const int size = liborRates.size();
>>>> vector<Date> liborDates(liborTenors.size());
>>>> for (int i = 0; i < size; i++)
>>>> {
>>>> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
>>>> liborDates[i] = curDate;
>>>> }
>>>> yieldCurve = shared_ptr<YieldTermStructure>(new
>>>> InterpolatedForwardCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
>>>> ycDef.cal));
>>>> yieldCurve->enableExtrapolation();
>>>>
>>>> size = liborTenors.size();
>>>> forwardRates.clear();
>>>> forwardRates.resize(size);
>>>> try
>>>> {
>>>> forwardRates[i] = yieldCurve->forwardRate(ycDef.evalDate, ycDef.evalDate +
>>>> liborTenors[i] , ycDef.dc, Compounded, Annual);
>>>> }
>>>> catch(QuantLib::Error& e)
>>>> {
>>>> cout << e.what() << endl;
>>>> throw;
>>>> }
>>>>
>>>> liborDates has below values -
>>>>
>>>> July 20th, 2014
>>>> January 20th, 2015
>>>> January 20th, 2016
>>>> January 20th, 2017
>>>> January 20th, 2018
>>>> January 20th, 2019
>>>> January 20th, 2020
>>>> January 20th, 2021
>>>> January 20th, 2022
>>>> January 20th, 2023
>>>> January 20th, 2024
>>>> January 20th, 2029
>>>>
>>>> while liborRates is
>>>> 8.53854
>>>> 8.40083
>>>> 8.39311
>>>> 8.44955
>>>> 8.56089
>>>> 8.65359
>>>> 8.68869
>>>> 8.80096
>>>> 8.9133
>>>> 8.74109
>>>> 8.66277
>>>> 8.98536
>>>>
>>>> eval date is January 20th, 2014
>>>>
>>>> What is causing negative time exception?
>>>>
>>>> Thanks,
>>>> Varun
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://quantlib.10058.n7.nabble.com/Negative-price-with-Forward-Rates-tp14868.html
>>>> Sent from the quantlib-dev mailing list archive at Nabble.com.
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>>> Critical Workloads, Development Environments & Everything In Between.
>>>> Get a Quote or Start a Free Trial Today.
>>>>
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> QuantLib-dev mailing list
>>>> Qua...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>>>
>>>
>>>
>>>
>>> --
>>> <https://implementingquantlib.blogspot.com>
>>> <https://twitter.com/lballabio
>>>>
>>>
>>>
>>
>>
>>
>> --
>> <https://implementingquantlib.blogspot.com>
>> <https://twitter.com/lballabio>
>>
>> ------------------------------------------------------------------------------
>> WatchGuard Dimension instantly turns raw network data into actionable
>> security intelligence. It gives you real-time visual feedback on key
>> security issues and trends. Skip the complicated setup - simply import
>> a virtual appliance and go from zero to informed in seconds.
>> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
>> _______________________________________________
>> QuantLib-dev mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
|
|
From: Luigi B. <lui...@gm...> - 2014-02-01 15:37:53
|
Those are valid interpolations, but PiecewiseYieldCurve needs the corresponding traits class (i.e., the one that defines an interpolate() method that returns an Interpolation instance). For the various cubic interpolations, that would be the Cubic class. It maps to the various kinds of cubic depending on the parameters you use to create it. If you use, say, PiecewiseYieldCurve<Discount,Cubic> and just build it with the curve information (helpers etc), it will use the default parameters (which, I think, give you a Kruger cubic). If you create an instance of Cubic explicitly and pass it to the constructor of PiecewiseYieldCurve<Discount,Cubic> as the last, optional parameter, you'll get the corresponding cubic. You can see the parameters to use for each interpolation by looking at its constructor and checking what parameters it passes to the base CubicInterpolation class. Luigi On Wed, Jan 29, 2014 at 6:31 PM, jlee <jon...@gm...> wrote: > Got it to work your with suggestion. But have a related question. Is there a > list of available interpolation classes? I was able to get working: > > Discount, BackwardFlat > Discount, ForwardFlat > Discount, Linear > Discount, LogLinear > > but when i tried: > > CubicNaturalSpline > LogCubicNaturalSpline > MonotonicCubicNaturalSpline > KrugerCubic > FritschButlandCubic > Parabolic > LogParabolic > MonotonicParabolic > MonotonicLogParabolic > Abcd > Bilinear > Bicubic > > I get compile a error saying no default constructor. Are these valid methods > as these seems to be ones I've search around in the code. > > Thanks, > Jon > > > > -- > View this message in context: http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14918p14923.html > Sent from the quantlib-dev mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > WatchGuard Dimension instantly turns raw network data into actionable > security intelligence. It gives you real-time visual feedback on key > security issues and trends. Skip the complicated setup - simply import > a virtual appliance and go from zero to informed in seconds. > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev -- <https://implementingquantlib.blogspot.com> <https://twitter.com/lballabio> |
|
From: aazout <alb...@so...> - 2014-01-30 19:39:19
|
Was this issue fixed? I am struggling with the same problem on Mavericks. -- View this message in context: http://quantlib.10058.n7.nabble.com/QuantLib-boost-1-55-tp14715p14926.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: jlee <jon...@gm...> - 2014-01-29 17:32:13
|
Got it to work your with suggestion. But have a related question. Is there a list of available interpolation classes? I was able to get working: Discount, BackwardFlat Discount, ForwardFlat Discount, Linear Discount, LogLinear but when i tried: CubicNaturalSpline LogCubicNaturalSpline MonotonicCubicNaturalSpline KrugerCubic FritschButlandCubic Parabolic LogParabolic MonotonicParabolic MonotonicLogParabolic Abcd Bilinear Bicubic I get compile a error saying no default constructor. Are these valid methods as these seems to be ones I've search around in the code. Thanks, Jon -- View this message in context: http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14918p14923.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: jlee <jon...@gm...> - 2014-01-29 16:43:17
|
Thanks for the quick reply. Let me give this a way and see. Thanks for your help! On 29 January 2014 15:57, Luigi Ballabio [via QuantLib] < ml-...@n7...> wrote: > Hello, > template arguments have to be specified at compile time, so I'm > afraid there's no way except a big > > if (traits == "Discount" && interpolation == "Linear") > return make_shared<PiecewiseYieldCurve<Discount,Linear> >(...); > else if (traits == "Discount" && interpolation == "LogLinear") > return make_shared<PiecewiseYieldCurve<Discount,LogLinear> >(...); > > To minimize inconvenience, I'd put the above inside a function so that > I'd only write it once. Then in client code I'd just write > > shared_ptr<YieldTermStructure> curve = make_piecewise(traits, > interpolation, helpers, ...); > > Luigi > > > On Wed, Jan 29, 2014 at 2:49 PM, jlee <[hidden email]<http://user/SendEmail.jtp?type=node&node=14919&i=0>> > wrote: > > > Hi all, > > Pretty new to QuantLib and have been playing with the Example sources. I > > have a question regarding the PiecewiseYieldCurve object. If I want to > make > > the first two parameters (traitid and interpolatorid) an input variable > how > > can I do this? Specifically, I'm looking at the swapvaluation.cpp > example > > where it is using "Discount" and "LogLinear". I want to make it a user > input > > so the interpolation method can be changed. Sorry it's probably more of > a > > C++ question as I'm a bit weak on templates. > > > > Thank you, > > Jon > > > > > > > > -- > > View this message in context: > http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14918.html > > Sent from the quantlib-dev mailing list archive at Nabble.com. > > > > > ------------------------------------------------------------------------------ > > > WatchGuard Dimension instantly turns raw network data into actionable > > security intelligence. It gives you real-time visual feedback on key > > security issues and trends. Skip the complicated setup - simply import > > a virtual appliance and go from zero to informed in seconds. > > > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk > > _______________________________________________ > > QuantLib-dev mailing list > > [hidden email] <http://user/SendEmail.jtp?type=node&node=14919&i=1> > > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > > > -- > <https://implementingquantlib.blogspot.com> > <https://twitter.com/lballabio> > > ------------------------------------------------------------------------------ > > WatchGuard Dimension instantly turns raw network data into actionable > security intelligence. It gives you real-time visual feedback on key > security issues and trends. Skip the complicated setup - simply import > a virtual appliance and go from zero to informed in seconds. > > http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-dev mailing list > [hidden email] <http://user/SendEmail.jtp?type=node&node=14919&i=2> > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14918p14919.html > To unsubscribe from PiecewiseYieldCurve question, click here<http://quantlib.10058.n7.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=14918&code=am9uLmhvbm1pbmcubGVlQGdtYWlsLmNvbXwxNDkxOHwtNzA1MDY5Mzg2> > . > NAML<http://quantlib.10058.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14918p14922.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: Luigi B. <lui...@gm...> - 2014-01-29 14:55:44
|
Hello,
template arguments have to be specified at compile time, so I'm
afraid there's no way except a big
if (traits == "Discount" && interpolation == "Linear")
return make_shared<PiecewiseYieldCurve<Discount,Linear> >(...);
else if (traits == "Discount" && interpolation == "LogLinear")
return make_shared<PiecewiseYieldCurve<Discount,LogLinear> >(...);
To minimize inconvenience, I'd put the above inside a function so that
I'd only write it once. Then in client code I'd just write
shared_ptr<YieldTermStructure> curve = make_piecewise(traits,
interpolation, helpers, ...);
Luigi
On Wed, Jan 29, 2014 at 2:49 PM, jlee <jon...@gm...> wrote:
> Hi all,
> Pretty new to QuantLib and have been playing with the Example sources. I
> have a question regarding the PiecewiseYieldCurve object. If I want to make
> the first two parameters (traitid and interpolatorid) an input variable how
> can I do this? Specifically, I'm looking at the swapvaluation.cpp example
> where it is using "Discount" and "LogLinear". I want to make it a user input
> so the interpolation method can be changed. Sorry it's probably more of a
> C++ question as I'm a bit weak on templates.
>
> Thank you,
> Jon
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14918.html
> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends. Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
|
|
From: jlee <jon...@gm...> - 2014-01-29 13:50:23
|
Hi all, Pretty new to QuantLib and have been playing with the Example sources. I have a question regarding the PiecewiseYieldCurve object. If I want to make the first two parameters (traitid and interpolatorid) an input variable how can I do this? Specifically, I'm looking at the swapvaluation.cpp example where it is using "Discount" and "LogLinear". I want to make it a user input so the interpolation method can be changed. Sorry it's probably more of a C++ question as I'm a bit weak on templates. Thank you, Jon -- View this message in context: http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14918.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: jlee <jon...@gm...> - 2014-01-29 13:49:57
|
Hi all, Pretty new to QuantLib and have been playing with the Example sources. I have a question regarding the PiecewiseYieldCurve object. If I want to make the first two parameters (traitid and interpolatorid) an input variable how can I do this? Specifically, I'm looking at the swapvaluation.cpp example where it is using "Discount" and "LogLinear". I want to make it a user input so the interpolation method can be changed. Sorry it's probably more of a C++ question as I'm a bit weak on templates. Thank you, Jon -- View this message in context: http://quantlib.10058.n7.nabble.com/PiecewiseYieldCurve-question-tp14917.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: Peter C. <pca...@gm...> - 2014-01-28 12:21:08
|
Luigi, just out of curiosity, in ForwardRateStructure there seems to
be a general purpose implementation to get the zero yield by
integration over the forwards. Wouldn't the situation here be a use
case for exactly this (i.e. catch the exception and invoke the base
class method instead) ?
best, Peter
On 28 January 2014 12:37, Luigi Ballabio <lui...@gm...> wrote:
> Yes. the curve is trying to integrate the forwards to get the
> discounts, but the LogLinear interpolator doesn't provide a formula
> for that. You'll have to choose another interpolation.
>
> Luigi
>
> On Mon, Jan 27, 2014 at 5:50 AM, varun yadav <var...@ya...> wrote:
>> Hi Luigi,
>>
>> I passed evaluation date as the first date in liborDates. Also added
>> corresponding rate in liborRates. But now it gives exception -
>> "LogInterpolation primitive not implemented"
>>
>> Below are new values -
>>
>> liborDates -
>>
>> January 24th, 2014
>> July 24th, 2014
>> January 24th, 2015
>> January 24th, 2016
>> January 24th, 2017
>> January 24th, 2018
>> January 24th, 2019
>> January 24th, 2020
>> January 24th, 2021
>> January 24th, 2022
>> January 24th, 2023
>> January 24th, 2024
>> January 24th, 2029
>>
>> liborRates -
>>
>> 8.4
>> 8.4955
>> 8.36907
>> 8.38416
>> 8.47267
>> 8.62786
>> 8.69832
>> 8.71107
>> 8.85289
>> 8.99607
>> 8.80085
>> 8.7099
>> 9.00594
>>
>> Is exception coming due to InterpolatedForwardCurve<LogLinear> ...?
>>
>> Thanks in advance!
>>
>>
>> On Thursday, January 23, 2014 5:02 PM, Luigi Ballabio
>> <lui...@gm...> wrote:
>> You should pass the evaluation date as the first date in liborDates.
>> You'll need a corresponding extra element in liborRates; just
>> replicate the first you have for constant rates from today to the
>> first actual Libor date.
>>
>> Luigi
>>
>> On Mon, Jan 20, 2014 at 8:12 AM, v17 <var...@ya...> wrote:
>>> Hi Everyone,
>>>
>>> I have following piece of code which gives Exception "negative time (-0.5)
>>> given"
>>>
>>> vector <Real> &forwardRates;
>>> const int size = liborRates.size();
>>> vector<Date> liborDates(liborTenors.size());
>>> for (int i = 0; i < size; i++)
>>> {
>>> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
>>> liborDates[i] = curDate;
>>> }
>>> yieldCurve = shared_ptr<YieldTermStructure>(new
>>> InterpolatedForwardCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
>>> ycDef.cal));
>>> yieldCurve->enableExtrapolation();
>>>
>>> size = liborTenors.size();
>>> forwardRates.clear();
>>> forwardRates.resize(size);
>>> try
>>> {
>>> forwardRates[i] = yieldCurve->forwardRate(ycDef.evalDate, ycDef.evalDate +
>>> liborTenors[i] , ycDef.dc, Compounded, Annual);
>>> }
>>> catch(QuantLib::Error& e)
>>> {
>>> cout << e.what() << endl;
>>> throw;
>>> }
>>>
>>> liborDates has below values -
>>>
>>> July 20th, 2014
>>> January 20th, 2015
>>> January 20th, 2016
>>> January 20th, 2017
>>> January 20th, 2018
>>> January 20th, 2019
>>> January 20th, 2020
>>> January 20th, 2021
>>> January 20th, 2022
>>> January 20th, 2023
>>> January 20th, 2024
>>> January 20th, 2029
>>>
>>> while liborRates is
>>> 8.53854
>>> 8.40083
>>> 8.39311
>>> 8.44955
>>> 8.56089
>>> 8.65359
>>> 8.68869
>>> 8.80096
>>> 8.9133
>>> 8.74109
>>> 8.66277
>>> 8.98536
>>>
>>> eval date is January 20th, 2014
>>>
>>> What is causing negative time exception?
>>>
>>> Thanks,
>>> Varun
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://quantlib.10058.n7.nabble.com/Negative-price-with-Forward-Rates-tp14868.html
>>> Sent from the quantlib-dev mailing list archive at Nabble.com.
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>>> Critical Workloads, Development Environments & Everything In Between.
>>> Get a Quote or Start a Free Trial Today.
>>>
>>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>>> _______________________________________________
>>> QuantLib-dev mailing list
>>> Qua...@li...
>>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>>
>>
>>
>>
>> --
>> <https://implementingquantlib.blogspot.com>
>> <https://twitter.com/lballabio
>>>
>>
>>
>
>
>
> --
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio>
>
> ------------------------------------------------------------------------------
> WatchGuard Dimension instantly turns raw network data into actionable
> security intelligence. It gives you real-time visual feedback on key
> security issues and trends. Skip the complicated setup - simply import
> a virtual appliance and go from zero to informed in seconds.
> http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|
|
From: Luigi B. <lui...@gm...> - 2014-01-28 11:37:41
|
Yes. the curve is trying to integrate the forwards to get the
discounts, but the LogLinear interpolator doesn't provide a formula
for that. You'll have to choose another interpolation.
Luigi
On Mon, Jan 27, 2014 at 5:50 AM, varun yadav <var...@ya...> wrote:
> Hi Luigi,
>
> I passed evaluation date as the first date in liborDates. Also added
> corresponding rate in liborRates. But now it gives exception -
> "LogInterpolation primitive not implemented"
>
> Below are new values -
>
> liborDates -
>
> January 24th, 2014
> July 24th, 2014
> January 24th, 2015
> January 24th, 2016
> January 24th, 2017
> January 24th, 2018
> January 24th, 2019
> January 24th, 2020
> January 24th, 2021
> January 24th, 2022
> January 24th, 2023
> January 24th, 2024
> January 24th, 2029
>
> liborRates -
>
> 8.4
> 8.4955
> 8.36907
> 8.38416
> 8.47267
> 8.62786
> 8.69832
> 8.71107
> 8.85289
> 8.99607
> 8.80085
> 8.7099
> 9.00594
>
> Is exception coming due to InterpolatedForwardCurve<LogLinear> ...?
>
> Thanks in advance!
>
>
> On Thursday, January 23, 2014 5:02 PM, Luigi Ballabio
> <lui...@gm...> wrote:
> You should pass the evaluation date as the first date in liborDates.
> You'll need a corresponding extra element in liborRates; just
> replicate the first you have for constant rates from today to the
> first actual Libor date.
>
> Luigi
>
> On Mon, Jan 20, 2014 at 8:12 AM, v17 <var...@ya...> wrote:
>> Hi Everyone,
>>
>> I have following piece of code which gives Exception "negative time (-0.5)
>> given"
>>
>> vector <Real> &forwardRates;
>> const int size = liborRates.size();
>> vector<Date> liborDates(liborTenors.size());
>> for (int i = 0; i < size; i++)
>> {
>> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
>> liborDates[i] = curDate;
>> }
>> yieldCurve = shared_ptr<YieldTermStructure>(new
>> InterpolatedForwardCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
>> ycDef.cal));
>> yieldCurve->enableExtrapolation();
>>
>> size = liborTenors.size();
>> forwardRates.clear();
>> forwardRates.resize(size);
>> try
>> {
>> forwardRates[i] = yieldCurve->forwardRate(ycDef.evalDate, ycDef.evalDate +
>> liborTenors[i] , ycDef.dc, Compounded, Annual);
>> }
>> catch(QuantLib::Error& e)
>> {
>> cout << e.what() << endl;
>> throw;
>> }
>>
>> liborDates has below values -
>>
>> July 20th, 2014
>> January 20th, 2015
>> January 20th, 2016
>> January 20th, 2017
>> January 20th, 2018
>> January 20th, 2019
>> January 20th, 2020
>> January 20th, 2021
>> January 20th, 2022
>> January 20th, 2023
>> January 20th, 2024
>> January 20th, 2029
>>
>> while liborRates is
>> 8.53854
>> 8.40083
>> 8.39311
>> 8.44955
>> 8.56089
>> 8.65359
>> 8.68869
>> 8.80096
>> 8.9133
>> 8.74109
>> 8.66277
>> 8.98536
>>
>> eval date is January 20th, 2014
>>
>> What is causing negative time exception?
>>
>> Thanks,
>> Varun
>>
>>
>>
>> --
>> View this message in context:
>> http://quantlib.10058.n7.nabble.com/Negative-price-with-Forward-Rates-tp14868.html
>> Sent from the quantlib-dev mailing list archive at Nabble.com.
>>
>>
>> ------------------------------------------------------------------------------
>> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
>> Learn Why More Businesses Are Choosing CenturyLink Cloud For
>> Critical Workloads, Development Environments & Everything In Between.
>> Get a Quote or Start a Free Trial Today.
>>
>> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
>> _______________________________________________
>> QuantLib-dev mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
>
>
>
> --
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio
>>
>
>
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
|
|
From: varun y. <var...@ya...> - 2014-01-27 04:50:25
|
Hi Luigi,
I passed evaluation date as the first date in liborDates. Also added corresponding rate in liborRates. But now it gives exception - "LogInterpolation primitive not implemented"
Below are new values -
liborDates -
January 24th, 2014
July 24th, 2014
January 24th, 2015
January 24th, 2016
January 24th, 2017
January 24th, 2018
January 24th, 2019
January 24th, 2020
January 24th, 2021
January 24th, 2022
January 24th, 2023
January 24th, 2024
January 24th, 2029
liborRates -
8.4
8.4955
8.36907
8.38416
8.47267
8.62786
8.69832
8.71107
8.85289
8.99607
8.80085
8.7099
9.00594
Is exception coming due to InterpolatedForwardCurve<LogLinear> ...?
Thanks in advance!
On Thursday, January 23, 2014 5:02 PM, Luigi Ballabio <lui...@gm...> wrote:
You should pass the evaluation date as the first date in liborDates.
You'll need a corresponding extra element in liborRates; just
replicate the first you have for constant rates from today to the
first actual Libor date.
Luigi
On Mon, Jan 20, 2014 at 8:12 AM, v17 <var...@ya...> wrote:
> Hi Everyone,
>
> I have following piece of code which gives Exception "negative time (-0.5)
> given"
>
> vector <Real> &forwardRates;
> const int size = liborRates.size();
> vector<Date> liborDates(liborTenors.size());
> for (int i = 0; i < size; i++)
> {
> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
> liborDates[i] = curDate;
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
>
InterpolatedForwardCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
> ycDef.cal));
> yieldCurve->enableExtrapolation();
>
> size = liborTenors.size();
> forwardRates.clear();
> forwardRates.resize(size);
> try
> {
> forwardRates[i] = yieldCurve->forwardRate(ycDef.evalDate, ycDef.evalDate +
> liborTenors[i] , ycDef.dc, Compounded, Annual);
> }
> catch(QuantLib::Error& e)
> {
> cout << e.what() << endl;
> throw;
> }
>
> liborDates has below values -
>
> July 20th, 2014
> January 20th, 2015
> January 20th, 2016
> January 20th, 2017
> January 20th, 2018
> January 20th, 2019
> January 20th, 2020
> January 20th, 2021
> January 20th, 2022
> January 20th, 2023
> January 20th, 2024
> January 20th, 2029
>
> while liborRates is
> 8.53854
> 8.40083
> 8.39311
> 8.44955
> 8.56089
> 8.65359
> 8.68869
> 8.80096
> 8.9133
> 8.74109
> 8.66277
> 8.98536
>
> eval date is January 20th, 2014
>
> What is causing negative time exception?
>
>
Thanks,
> Varun
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Negative-price-with-Forward-Rates-tp14868.html
> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio
> |
|
From: Luigi B. <lui...@gm...> - 2014-01-23 11:32:51
|
You should pass the evaluation date as the first date in liborDates.
You'll need a corresponding extra element in liborRates; just
replicate the first you have for constant rates from today to the
first actual Libor date.
Luigi
On Mon, Jan 20, 2014 at 8:12 AM, v17 <var...@ya...> wrote:
> Hi Everyone,
>
> I have following piece of code which gives Exception "negative time (-0.5)
> given"
>
> vector <Real> &forwardRates;
> const int size = liborRates.size();
> vector<Date> liborDates(liborTenors.size());
> for (int i = 0; i < size; i++)
> {
> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
> liborDates[i] = curDate;
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
> InterpolatedForwardCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
> ycDef.cal));
> yieldCurve->enableExtrapolation();
>
> size = liborTenors.size();
> forwardRates.clear();
> forwardRates.resize(size);
> try
> {
> forwardRates[i] = yieldCurve->forwardRate(ycDef.evalDate, ycDef.evalDate +
> liborTenors[i] , ycDef.dc, Compounded, Annual);
> }
> catch(QuantLib::Error& e)
> {
> cout << e.what() << endl;
> throw;
> }
>
> liborDates has below values -
>
> July 20th, 2014
> January 20th, 2015
> January 20th, 2016
> January 20th, 2017
> January 20th, 2018
> January 20th, 2019
> January 20th, 2020
> January 20th, 2021
> January 20th, 2022
> January 20th, 2023
> January 20th, 2024
> January 20th, 2029
>
> while liborRates is
> 8.53854
> 8.40083
> 8.39311
> 8.44955
> 8.56089
> 8.65359
> 8.68869
> 8.80096
> 8.9133
> 8.74109
> 8.66277
> 8.98536
>
> eval date is January 20th, 2014
>
> What is causing negative time exception?
>
> Thanks,
> Varun
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Negative-price-with-Forward-Rates-tp14868.html
> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
|
|
From: v17 <var...@ya...> - 2014-01-20 07:12:40
|
Hi Everyone,
I have following piece of code which gives Exception "negative time (-0.5)
given"
vector <Real> &forwardRates;
const int size = liborRates.size();
vector<Date> liborDates(liborTenors.size());
for (int i = 0; i < size; i++)
{
curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
liborDates[i] = curDate;
}
yieldCurve = shared_ptr<YieldTermStructure>(new
InterpolatedForwardCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
ycDef.cal));
yieldCurve->enableExtrapolation();
size = liborTenors.size();
forwardRates.clear();
forwardRates.resize(size);
try
{
forwardRates[i] = yieldCurve->forwardRate(ycDef.evalDate, ycDef.evalDate +
liborTenors[i] , ycDef.dc, Compounded, Annual);
}
catch(QuantLib::Error& e)
{
cout << e.what() << endl;
throw;
}
liborDates has below values -
July 20th, 2014
January 20th, 2015
January 20th, 2016
January 20th, 2017
January 20th, 2018
January 20th, 2019
January 20th, 2020
January 20th, 2021
January 20th, 2022
January 20th, 2023
January 20th, 2024
January 20th, 2029
while liborRates is
8.53854
8.40083
8.39311
8.44955
8.56089
8.65359
8.68869
8.80096
8.9133
8.74109
8.66277
8.98536
eval date is January 20th, 2014
What is causing negative time exception?
Thanks,
Varun
--
View this message in context: http://quantlib.10058.n7.nabble.com/Negative-price-with-Forward-Rates-tp14868.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|
|
From: Cheng Li <scr...@gm...> - 2014-01-16 13:44:48
|
Make sure that the zero rates dates are all later than the earliest date in your curve.
发自我的 iPad
> 在 2014年1月16日,13:48,v17 <var...@ya...> 写道:
>
> Hi,
>
> Request members help on the below issue -
>
> I have following code in my project -
>
> boost::shared_ptr<YieldTermStructure>
> CYieldCurveUtils::MakeTermStructure(const vector<Rate> &liborRates, const
> vector<Period> &liborTenors, YieldCurveDef &_ycDef, bool zeroRates ){
>
> ycDef = _ycDef;
> ycDef.evalDate = ycDef.cal.advance(ycDef.evalDate, -2, Days);
>
> const int size = liborRates.size();
> std::vector<shared_ptr<RateHelper>> instruments;
> Period oneYear(1, Years);
> shared_ptr<Euribor> swapIndex(new Euribor(6 * Months));
> vector<Date> liborDates(liborTenors.size());
> Date curDate;
> if (!zeroRates){
> for (int idx = 0; idx < size; idx++){
> if (liborTenors[idx] < oneYear){
> shared_ptr<RateHelper> rateHelper(new
> DepositRateHelper(liborRates[idx],liborTenors[idx],ycDef.fixingDays,ycDef.cal,
> ycDef.bdc, ycDef.endOfMonth, ycDef.dc));
> instruments.push_back(rateHelper);
> }
> else {
> shared_ptr<RateHelper> rateHelper(new
> SwapRateHelper(liborRates[idx],liborTenors[idx], ycDef.cal, ycDef.freq,
> ycDef.bdc, ycDef.dc, swapIndex));
> instruments.push_back(rateHelper);
> }
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
> PiecewiseYieldCurve<Discount, LogLinear, IterativeBootstrap>(ycDef.evalDate,
> instruments, ycDef.dc));
> yieldCurve->enableExtrapolation();
> }
> else{
> for (int i = 0; i < size; i++){
> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
> liborDates[i] = curDate;
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
> InterpolatedZeroCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
> ycDef.cal));
> yieldCurve->enableExtrapolation();
> }
> return yieldCurve;
> }
>
>
> void GetZeroRates(const vector<Real> &liborRates, const vector<Period>
> &liborTenors, vector <Real> &zeroRates, YieldCurveDef &_ycDef){
> boost::shared_ptr<YieldTermStructure> ptrYiedCurve =
> MakeTermStructure(liborRates, liborTenors, _ycDef, true);
> int size = liborTenors.size();
> zeroRates.clear();
> zeroRates.resize(size);
> for (int i = 0; i < size; i++){
> zeroRates[i] = ptrYiedCurve->zeroRate(_ycDef.evalDate + liborTenors[i],
> _ycDef.dc, Compounded, Annual);
> //std::cout << "Rate = " << yieldCurve->forwardRate(_ycDef.evalDate +
> Period(1*Years), _ycDef.evalDate + Period(1*Years) + periods[i] , _ycDef.dc,
> Compounded, Annual) << std::endl;
> }
>
> }
>
>
> Program crashes when it hits zeroRate(...) function. Is it looking for
> discountImpl function implementation? I am using InterpolatedZeroCurve which
> provides the implementation for discountImpl and zeroYieldImpl functions.
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Facing-app-crash-with-zeroRate-function-tp14853.html
> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
|
|
From: v17 <var...@ya...> - 2014-01-16 11:30:58
|
Hi Luigi,
I found the issue.
Code was incorrectly using PiecewiseYieldCurve, DepositeRate/SwapRateHelper instead of InterpolatedZeroCurve for zero rates
My bad.
Sorry for that and thanks for looking :)
Thanks,
Varun Yadav
On Thursday, January 16, 2014 2:50 PM, Luigi Ballabio [via QuantLib] <ml-...@n7...> wrote:
Hello,
I'll run your code when I have some time, but in the meantime you
can try catching the exception and printing out its message to see
what the library is telling you, as in:
try {
GetZeroRates(...);
} catch (QuantLib::Error& e) {
cout << e.what() << endl;
throw;
}
Luigi
On Thu, Jan 16, 2014 at 6:48 AM, v17 <[hidden email]> wrote:
> Hi,
>
> Request members help on the below issue -
>
> I have following code in my project -
>
> boost::shared_ptr<YieldTermStructure>
> CYieldCurveUtils::MakeTermStructure(const vector<Rate> &liborRates, const
> vector<Period> &liborTenors, YieldCurveDef &_ycDef, bool zeroRates ){
>
> ycDef = _ycDef;
> ycDef.evalDate = ycDef.cal.advance(ycDef.evalDate, -2, Days);
>
> const int size = liborRates.size();
> std::vector<shared_ptr<RateHelper>> instruments;
> Period oneYear(1, Years);
> shared_ptr<Euribor> swapIndex(new Euribor(6 * Months));
> vector<Date> liborDates(liborTenors.size());
> Date curDate;
> if (!zeroRates){
> for (int idx = 0; idx < size; idx++){
> if (liborTenors[idx] < oneYear){
> shared_ptr<RateHelper> rateHelper(new
> DepositRateHelper(liborRates[idx],liborTenors[idx],ycDef.fixingDays,ycDef.cal,
> ycDef.bdc, ycDef.endOfMonth, ycDef.dc));
> instruments.push_back(rateHelper);
> }
> else {
> shared_ptr<RateHelper> rateHelper(new
> SwapRateHelper(liborRates[idx],liborTenors[idx], ycDef.cal, ycDef.freq,
> ycDef.bdc, ycDef.dc, swapIndex));
> instruments.push_back(rateHelper);
> }
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
> PiecewiseYieldCurve<Discount, LogLinear, IterativeBootstrap>(ycDef.evalDate,
> instruments, ycDef.dc));
> yieldCurve->enableExtrapolation();
> }
> else{
> for (int i = 0; i < size; i++){
> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
> liborDates[i] = curDate;
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
> InterpolatedZeroCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
> ycDef.cal));
> yieldCurve->enableExtrapolation();
> }
> return yieldCurve;
> }
>
>
> void GetZeroRates(const vector<Real> &liborRates, const vector<Period>
> &liborTenors, vector <Real> &zeroRates, YieldCurveDef &_ycDef){
> boost::shared_ptr<YieldTermStructure> ptrYiedCurve =
> MakeTermStructure(liborRates, liborTenors, _ycDef, true);
> int size = liborTenors.size();
> zeroRates.clear();
> zeroRates.resize(size);
> for (int i = 0; i < size; i++){
> zeroRates[i] = ptrYiedCurve->zeroRate(_ycDef.evalDate + liborTenors[i],
> _ycDef.dc, Compounded, Annual);
> //std::cout << "Rate = " << yieldCurve->forwardRate(_ycDef.evalDate +
> Period(1*Years), _ycDef.evalDate + Period(1*Years) + periods[i] , _ycDef.dc,
> Compounded, Annual) << std::endl;
> }
>
> }
>
>
> Program crashes when it hits zeroRate(...) function. Is it looking for
> discountImpl function implementation? I am using InterpolatedZeroCurve which
> provides the implementation for discountImpl and zeroYieldImpl functions.
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Facing-app-crash-with-zeroRate-function-tp14853.html
> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
________________________________
If you reply to this email, your message will be added to the discussion below:http://quantlib.10058.n7.nabble.com/Facing-app-crash-with-zeroRate-function-tp14853p14854.html
To unsubscribe from Facing app crash with zeroRate function, click here.
NAML
--
View this message in context: http://quantlib.10058.n7.nabble.com/Facing-app-crash-with-zeroRate-function-tp14853p14857.html
Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: Luigi B. <lui...@gm...> - 2014-01-16 09:18:54
|
Hello,
I'll run your code when I have some time, but in the meantime you
can try catching the exception and printing out its message to see
what the library is telling you, as in:
try {
GetZeroRates(...);
} catch (QuantLib::Error& e) {
cout << e.what() << endl;
throw;
}
Luigi
On Thu, Jan 16, 2014 at 6:48 AM, v17 <var...@ya...> wrote:
> Hi,
>
> Request members help on the below issue -
>
> I have following code in my project -
>
> boost::shared_ptr<YieldTermStructure>
> CYieldCurveUtils::MakeTermStructure(const vector<Rate> &liborRates, const
> vector<Period> &liborTenors, YieldCurveDef &_ycDef, bool zeroRates ){
>
> ycDef = _ycDef;
> ycDef.evalDate = ycDef.cal.advance(ycDef.evalDate, -2, Days);
>
> const int size = liborRates.size();
> std::vector<shared_ptr<RateHelper>> instruments;
> Period oneYear(1, Years);
> shared_ptr<Euribor> swapIndex(new Euribor(6 * Months));
> vector<Date> liborDates(liborTenors.size());
> Date curDate;
> if (!zeroRates){
> for (int idx = 0; idx < size; idx++){
> if (liborTenors[idx] < oneYear){
> shared_ptr<RateHelper> rateHelper(new
> DepositRateHelper(liborRates[idx],liborTenors[idx],ycDef.fixingDays,ycDef.cal,
> ycDef.bdc, ycDef.endOfMonth, ycDef.dc));
> instruments.push_back(rateHelper);
> }
> else {
> shared_ptr<RateHelper> rateHelper(new
> SwapRateHelper(liborRates[idx],liborTenors[idx], ycDef.cal, ycDef.freq,
> ycDef.bdc, ycDef.dc, swapIndex));
> instruments.push_back(rateHelper);
> }
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
> PiecewiseYieldCurve<Discount, LogLinear, IterativeBootstrap>(ycDef.evalDate,
> instruments, ycDef.dc));
> yieldCurve->enableExtrapolation();
> }
> else{
> for (int i = 0; i < size; i++){
> curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
> liborDates[i] = curDate;
> }
> yieldCurve = shared_ptr<YieldTermStructure>(new
> InterpolatedZeroCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
> ycDef.cal));
> yieldCurve->enableExtrapolation();
> }
> return yieldCurve;
> }
>
>
> void GetZeroRates(const vector<Real> &liborRates, const vector<Period>
> &liborTenors, vector <Real> &zeroRates, YieldCurveDef &_ycDef){
> boost::shared_ptr<YieldTermStructure> ptrYiedCurve =
> MakeTermStructure(liborRates, liborTenors, _ycDef, true);
> int size = liborTenors.size();
> zeroRates.clear();
> zeroRates.resize(size);
> for (int i = 0; i < size; i++){
> zeroRates[i] = ptrYiedCurve->zeroRate(_ycDef.evalDate + liborTenors[i],
> _ycDef.dc, Compounded, Annual);
> //std::cout << "Rate = " << yieldCurve->forwardRate(_ycDef.evalDate +
> Period(1*Years), _ycDef.evalDate + Period(1*Years) + periods[i] , _ycDef.dc,
> Compounded, Annual) << std::endl;
> }
>
> }
>
>
> Program crashes when it hits zeroRate(...) function. Is it looking for
> discountImpl function implementation? I am using InterpolatedZeroCurve which
> provides the implementation for discountImpl and zeroYieldImpl functions.
>
>
>
>
> --
> View this message in context: http://quantlib.10058.n7.nabble.com/Facing-app-crash-with-zeroRate-function-tp14853.html
> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
|
|
From: v17 <var...@ya...> - 2014-01-16 05:48:33
|
Hi,
Request members help on the below issue -
I have following code in my project -
boost::shared_ptr<YieldTermStructure>
CYieldCurveUtils::MakeTermStructure(const vector<Rate> &liborRates, const
vector<Period> &liborTenors, YieldCurveDef &_ycDef, bool zeroRates ){
ycDef = _ycDef;
ycDef.evalDate = ycDef.cal.advance(ycDef.evalDate, -2, Days);
const int size = liborRates.size();
std::vector<shared_ptr<RateHelper>> instruments;
Period oneYear(1, Years);
shared_ptr<Euribor> swapIndex(new Euribor(6 * Months));
vector<Date> liborDates(liborTenors.size());
Date curDate;
if (!zeroRates){
for (int idx = 0; idx < size; idx++){
if (liborTenors[idx] < oneYear){
shared_ptr<RateHelper> rateHelper(new
DepositRateHelper(liborRates[idx],liborTenors[idx],ycDef.fixingDays,ycDef.cal,
ycDef.bdc, ycDef.endOfMonth, ycDef.dc));
instruments.push_back(rateHelper);
}
else {
shared_ptr<RateHelper> rateHelper(new
SwapRateHelper(liborRates[idx],liborTenors[idx], ycDef.cal, ycDef.freq,
ycDef.bdc, ycDef.dc, swapIndex));
instruments.push_back(rateHelper);
}
}
yieldCurve = shared_ptr<YieldTermStructure>(new
PiecewiseYieldCurve<Discount, LogLinear, IterativeBootstrap>(ycDef.evalDate,
instruments, ycDef.dc));
yieldCurve->enableExtrapolation();
}
else{
for (int i = 0; i < size; i++){
curDate = ycDef.cal.advance(ycDef.evalDate, liborTenors[i]);
liborDates[i] = curDate;
}
yieldCurve = shared_ptr<YieldTermStructure>(new
InterpolatedZeroCurve<LogLinear>(liborDates, liborRates, ycDef.dc,
ycDef.cal));
yieldCurve->enableExtrapolation();
}
return yieldCurve;
}
void GetZeroRates(const vector<Real> &liborRates, const vector<Period>
&liborTenors, vector <Real> &zeroRates, YieldCurveDef &_ycDef){
boost::shared_ptr<YieldTermStructure> ptrYiedCurve =
MakeTermStructure(liborRates, liborTenors, _ycDef, true);
int size = liborTenors.size();
zeroRates.clear();
zeroRates.resize(size);
for (int i = 0; i < size; i++){
zeroRates[i] = ptrYiedCurve->zeroRate(_ycDef.evalDate + liborTenors[i],
_ycDef.dc, Compounded, Annual);
//std::cout << "Rate = " << yieldCurve->forwardRate(_ycDef.evalDate +
Period(1*Years), _ycDef.evalDate + Period(1*Years) + periods[i] , _ycDef.dc,
Compounded, Annual) << std::endl;
}
}
Program crashes when it hits zeroRate(...) function. Is it looking for
discountImpl function implementation? I am using InterpolatedZeroCurve which
provides the implementation for discountImpl and zeroYieldImpl functions.
--
View this message in context: http://quantlib.10058.n7.nabble.com/Facing-app-crash-with-zeroRate-function-tp14853.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|
|
From: smazzucca <sma...@co...> - 2013-12-31 21:17:58
|
I am trying to add CPIBond to the SWIG interface file but I can tell that
some of my syntax is wrong:
%rename(CPIBond) CPIBondPtr;
class CPIBondPtr : public BondPtr {
%feature("kwargs") CPIBondPtr;
public:
%extend {
CPIBondPtr(
Real faceAmount,
bool growthOnly,
Real baseCPI,
const Period& observationLag,
const boost::shared_ptr<ZeroInflationIndex>& cpiIndex,
CPI::InterpolationType observationInterpolation,
const Schedule& schedule,
const std::vector<Rate>& coupons,
const DayCounter& accrualDayCounter,
BusinessDayConvention paymentConvention = ModifiedFollowing,
const Date& issueDate = Date()) {
return new CPIBondPtr(
new CPIBond(faceAmount, growthOnly, baseCPI,
observationLag, cpiIndex, observationInterpolation,
schedule, coupons, accrualDayCounter,
paymentConvention, issueDate));
}
}
};
Is there a map I can use to convert all the types ? If I had that, I think I
would be more independent in doing these conversions (and I have many more
in my future...).
Thank you,
Simon
--
View this message in context: http://quantlib.10058.n7.nabble.com/CPIBond-in-C-tp14797.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|
|
From: Dirk E. <ed...@de...> - 2013-12-30 20:04:09
|
On 30 December 2013 at 20:08, Luigi Ballabio wrote: | Ok, send me a pull request when you're done. Sorry for dropping the ball on | this one - I've been just disabling the Ruby build on my box for a while now... Will do. And for the official Debian builds, I had it on, off, and the on again for the last few years. It just works -- but there was an issue migrating from Ruby 1.8 to Ruby 1.9. And it looks like the patch will address it. Dirk -- Dirk Eddelbuettel | ed...@de... | http://dirk.eddelbuettel.com |
|
From: Luigi B. <lui...@gm...> - 2013-12-30 19:09:01
|
Ok, send me a pull request when you're done. Sorry for dropping the ball on this one - I've been just disabling the Ruby build on my box for a while now... Luigi On Dec 30, 2013 7:57 PM, "Dirk Eddelbuettel" <ed...@de...> wrote: > > I just got a patch from the fellow Debian maintainer who reported the bug; > details are at http://bugs.debian.org/733105 > > I'll test it fist but will then create a new branch and put it in there. > Ok? > > Dirk > > > On 30 December 2013 at 10:40, Dirk Eddelbuettel wrote: > | > | I have been building QuantLib-SWIG for Debian using Ruby 1.8. As Debian > is > | phasing out Ruby 1.8, I have been asked to update this to 1.9.1 or 2.0. > | > | However, I was unable to do so with the current files. First, I had to > | comment-out > | > | #require 'ftools' > | > | in setup.rb to get things to build, but after that the unit testing > framework > | croaked. > | > | (cd Ruby && \ > | CC="g++" \ > | CXX="g++" \ > | CFLAGS="-O2 -Wall -Wno-strict-aliasing" \ > | CXXFLAGS="-O2 -Wall -Wno-strict-aliasing" > \ > | ruby setup.rb build ) > | setup.rb:62: Use RbConfig instead of obsolete and deprecated Config. > | creating Makefile > | make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby' > | compiling quantlib_wrap.cpp > | quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, > VALUE*, VALUE)': > | quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named > 'len' > | Size size = RARRAY(argv[0])->len; > | ^ > | quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named > 'ptr' > | VALUE o = RARRAY(argv[0])->ptr[i]; > | ^ > | quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, > VALUE)': > | quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named > 'len' > | Size size = RARRAY(self)->len; > | ^ > | quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named > 'ptr' > | VALUE o = RARRAY(self)->ptr[i]; > | ^ > | and LOTS more of these errors. > | > | Later: > | > | (cd Ruby && ruby setup.rb test ) > | setup.rb:62: Use RbConfig instead of obsolete and deprecated Config. > | creating Makefile > | make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby' > | compiling quantlib_wrap.cpp > | quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, > VALUE*, VALUE)': > | quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named > 'len' > | Size size = RARRAY(argv[0])->len; > | ^ > | quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named > 'ptr' > | VALUE o = RARRAY(argv[0])->ptr[i]; > | ^ > | quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, > VALUE)': > | quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named > 'len' > | Size size = RARRAY(self)->len; > | ^ > | quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named > 'ptr' > | VALUE o = RARRAY(self)->ptr[i]; > | ^ > | ending in > | > | quantlib_wrap.cpp:245180:36: error: 'struct RArray' has no member named > 'ptr' > | VALUE o = RARRAY(argv[0])->ptr[i]; > | ^ > | make[1]: *** [quantlib_wrap.o] Error 1 > | make[1]: Leaving directory `/tmp/buildd/quantlib-swig-1.3/Ruby' > | /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot > load such file -- test/unit/testsuite (LoadError) > | from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' > | from QuantLibTestSuite.rb:20:in `<top (required)>' > | from setup.rb:134:in `load' > | from setup.rb:134:in `block in <main>' > | from setup.rb:70:in `call' > | from setup.rb:70:in `execute' > | from setup.rb:173:in `<main>' > | Testing QuantLib-Ruby 1.3... > | make: *** [test-stamp] Error 1 > | > | > | Any Ruby or Swig experts here who could lend a helping hand? > | > | Thanks, Dirk > | > | -- > | Dirk Eddelbuettel | ed...@de... | http://dirk.eddelbuettel.com > | > | > ------------------------------------------------------------------------------ > | Rapidly troubleshoot problems before they affect your business. Most IT > | organizations don't have a clear picture of how application performance > | affects their revenue. With AppDynamics, you get 100% visibility into > your > | Java,.NET, & PHP application. Start your 15-day FREE TRIAL of > AppDynamics Pro! > | > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > | _______________________________________________ > | QuantLib-dev mailing list > | Qua...@li... > | https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > -- > Dirk Eddelbuettel | ed...@de... | http://dirk.eddelbuettel.com > > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > |
|
From: Dirk E. <ed...@de...> - 2013-12-30 18:55:34
|
I just got a patch from the fellow Debian maintainer who reported the bug; details are at http://bugs.debian.org/733105 I'll test it fist but will then create a new branch and put it in there. Ok? Dirk On 30 December 2013 at 10:40, Dirk Eddelbuettel wrote: | | I have been building QuantLib-SWIG for Debian using Ruby 1.8. As Debian is | phasing out Ruby 1.8, I have been asked to update this to 1.9.1 or 2.0. | | However, I was unable to do so with the current files. First, I had to | comment-out | | #require 'ftools' | | in setup.rb to get things to build, but after that the unit testing framework | croaked. | | (cd Ruby && \ | CC="g++" \ | CXX="g++" \ | CFLAGS="-O2 -Wall -Wno-strict-aliasing" \ | CXXFLAGS="-O2 -Wall -Wno-strict-aliasing" \ | ruby setup.rb build ) | setup.rb:62: Use RbConfig instead of obsolete and deprecated Config. | creating Makefile | make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby' | compiling quantlib_wrap.cpp | quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, VALUE*, VALUE)': | quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named 'len' | Size size = RARRAY(argv[0])->len; | ^ | quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named 'ptr' | VALUE o = RARRAY(argv[0])->ptr[i]; | ^ | quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, VALUE)': | quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named 'len' | Size size = RARRAY(self)->len; | ^ | quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named 'ptr' | VALUE o = RARRAY(self)->ptr[i]; | ^ | and LOTS more of these errors. | | Later: | | (cd Ruby && ruby setup.rb test ) | setup.rb:62: Use RbConfig instead of obsolete and deprecated Config. | creating Makefile | make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby' | compiling quantlib_wrap.cpp | quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, VALUE*, VALUE)': | quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named 'len' | Size size = RARRAY(argv[0])->len; | ^ | quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named 'ptr' | VALUE o = RARRAY(argv[0])->ptr[i]; | ^ | quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, VALUE)': | quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named 'len' | Size size = RARRAY(self)->len; | ^ | quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named 'ptr' | VALUE o = RARRAY(self)->ptr[i]; | ^ | ending in | | quantlib_wrap.cpp:245180:36: error: 'struct RArray' has no member named 'ptr' | VALUE o = RARRAY(argv[0])->ptr[i]; | ^ | make[1]: *** [quantlib_wrap.o] Error 1 | make[1]: Leaving directory `/tmp/buildd/quantlib-swig-1.3/Ruby' | /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- test/unit/testsuite (LoadError) | from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' | from QuantLibTestSuite.rb:20:in `<top (required)>' | from setup.rb:134:in `load' | from setup.rb:134:in `block in <main>' | from setup.rb:70:in `call' | from setup.rb:70:in `execute' | from setup.rb:173:in `<main>' | Testing QuantLib-Ruby 1.3... | make: *** [test-stamp] Error 1 | | | Any Ruby or Swig experts here who could lend a helping hand? | | Thanks, Dirk | | -- | Dirk Eddelbuettel | ed...@de... | http://dirk.eddelbuettel.com | | ------------------------------------------------------------------------------ | Rapidly troubleshoot problems before they affect your business. Most IT | organizations don't have a clear picture of how application performance | affects their revenue. With AppDynamics, you get 100% visibility into your | Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! | http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk | _______________________________________________ | QuantLib-dev mailing list | Qua...@li... | https://lists.sourceforge.net/lists/listinfo/quantlib-dev -- Dirk Eddelbuettel | ed...@de... | http://dirk.eddelbuettel.com |
|
From: Dirk E. <ed...@de...> - 2013-12-30 16:54:00
|
I have been building QuantLib-SWIG for Debian using Ruby 1.8. As Debian is
phasing out Ruby 1.8, I have been asked to update this to 1.9.1 or 2.0.
However, I was unable to do so with the current files. First, I had to
comment-out
#require 'ftools'
in setup.rb to get things to build, but after that the unit testing framework
croaked.
(cd Ruby && \
CC="g++" \
CXX="g++" \
CFLAGS="-O2 -Wall -Wno-strict-aliasing" \
CXXFLAGS="-O2 -Wall -Wno-strict-aliasing" \
ruby setup.rb build )
setup.rb:62: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile
make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby'
compiling quantlib_wrap.cpp
quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named 'len'
Size size = RARRAY(argv[0])->len;
^
quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named 'ptr'
VALUE o = RARRAY(argv[0])->ptr[i];
^
quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named 'len'
Size size = RARRAY(self)->len;
^
quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named 'ptr'
VALUE o = RARRAY(self)->ptr[i];
^
and LOTS more of these errors.
Later:
(cd Ruby && ruby setup.rb test )
setup.rb:62: Use RbConfig instead of obsolete and deprecated Config.
creating Makefile
make[1]: Entering directory `/tmp/buildd/quantlib-swig-1.3/Ruby'
compiling quantlib_wrap.cpp
quantlib_wrap.cpp: In function 'VALUE _wrap_new_Array__SWIG_3(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46062:36: error: 'struct RArray' has no member named 'len'
Size size = RARRAY(argv[0])->len;
^
quantlib_wrap.cpp:46066:36: error: 'struct RArray' has no member named 'ptr'
VALUE o = RARRAY(argv[0])->ptr[i];
^
quantlib_wrap.cpp: In function 'VALUE _wrap_Array___len__(int, VALUE*, VALUE)':
quantlib_wrap.cpp:46190:33: error: 'struct RArray' has no member named 'len'
Size size = RARRAY(self)->len;
^
quantlib_wrap.cpp:46194:33: error: 'struct RArray' has no member named 'ptr'
VALUE o = RARRAY(self)->ptr[i];
^
ending in
quantlib_wrap.cpp:245180:36: error: 'struct RArray' has no member named 'ptr'
VALUE o = RARRAY(argv[0])->ptr[i];
^
make[1]: *** [quantlib_wrap.o] Error 1
make[1]: Leaving directory `/tmp/buildd/quantlib-swig-1.3/Ruby'
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- test/unit/testsuite (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from QuantLibTestSuite.rb:20:in `<top (required)>'
from setup.rb:134:in `load'
from setup.rb:134:in `block in <main>'
from setup.rb:70:in `call'
from setup.rb:70:in `execute'
from setup.rb:173:in `<main>'
Testing QuantLib-Ruby 1.3...
make: *** [test-stamp] Error 1
Any Ruby or Swig experts here who could lend a helping hand?
Thanks, Dirk
--
Dirk Eddelbuettel | ed...@de... | http://dirk.eddelbuettel.com
|
|
From: Luigi B. <lui...@gm...> - 2013-12-24 10:48:32
|
Hi Klaus,
yes, I agree. But don't write the patch right away. Enjoy your
holidays instead :)
Merry Christmas,
Luigi
On Tue, Dec 24, 2013 at 9:02 AM, Klaus Spanderen <kl...@sp...> wrote:
> Hi all,
>
>
>
> I have a question with respect to the ContinuousArithmeticAsianLevyEngine in
> the experimental/exoticoptions folder. It seems to me that this pricing
> engine only works if the averaging period has already begun. But if the
> averaging period begins in the future (meaning startDate is greater than
> process->process_->riskFreeRate()->referenceDate()) them I'm getting really
> unrealistic prices. Has someone else observed the same behaviour. In this
> case I'd suggest to throw an exception if startDate is in the future instead
> of giving back wrong results.
>
>
>
>
>
> Merry Christmas
>
> Klaus
>
>
> ------------------------------------------------------------------------------
> Rapidly troubleshoot problems before they affect your business. Most IT
> organizations don't have a clear picture of how application performance
> affects their revenue. With AppDynamics, you get 100% visibility into your
> Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics
> Pro!
> http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>
|
|
From: Klaus S. <kl...@sp...> - 2013-12-24 08:15:25
|
Hi all, I have a question with respect to the ContinuousArithmeticAsianLevyEngine in the experimental/exoticoptions folder. It seems to me that this pricing engine only works if the averaging period has already begun. But if the averaging period begins in the future (meaning startDate is greater than process- >process_->riskFreeRate()->referenceDate()) them I'm getting really unrealistic prices. Has someone else observed the same behaviour. In this case I'd suggest to throw an exception if startDate is in the future instead of giving back wrong results. Merry Christmas Klaus |
|
From: smazzucca <sma...@co...> - 2013-12-12 15:43:05
|
Was anybody successful in using QL via SWIG ? So far most of what I need is not there... Right now I'm trying to access convexity / bps / duration from CashFlows but I don't see any of them (I do see amount() and date()). Am I supposed to ? I see that convexity and duration are available via BondFunctions. Can BondFunctions be converted with SWIG ? Thank you, Simon -- View this message in context: http://quantlib.10058.n7.nabble.com/BondFunctions-via-SWIG-tp14724.html Sent from the quantlib-dev mailing list archive at Nabble.com. |