Send QuantLib-users mailing list submissions to [hidden email] To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/quantlib-users or, via email, send a message with subject or body 'help' to [hidden email] You can reach the person managing the list at [hidden email] When replying, please edit your Subject line so it is more specific than "Re: Contents of QuantLib-users digest..."
Today's Topics:
1. Re: SWIG Python - failure to register observer with
observable (aborodya)
2. Curve Building with Cubic Spline (suhasg)
3. About QuantLib compile with mingw and boost header.
(Hsiao-nan Cheung)
4. ??: About QuantLib compile with mingw and boost header.
(cheng li)
5. ??: Curve Building with Cubic Spline (cheng li)
| From: | aborodya <[hidden email]> |
| To: | [hidden email] |
| Subject: | Re: [Quantlib-users] SWIG Python - failure to register observerwith observable |
| Date: | Wed, 13 Aug 2014 07:27:49 -0700 (PDT) |
Sorry, Luigi, didn't see you reply -
I was to reproduce the functionality of TermStructureTest::testImpliedObs()
from the test suite.
So I defined a Flag class in Python
class Flag(Observer):
def __init__(self):
self.up_ = False
def raiseFlag(self):
self.up_ = True
def lowerFlag(self):
self.up_ = False
def isUp(self):
return self.up_
def update(self):
self.raiseFlag()
and created a function
def testImpliedObs(logger):
vars = CommonVars()
today = Settings.instance().evaluationDate
newToday = today + Period(3,Years)
newSettlement = vars.calendar.advance(newToday,
vars.settlementDays, Days)
h = RelinkableYieldTermStructureHandle()
implied = ImpliedTermStructure(h, newSettlement)
flag = Flag()
flag.registerWith(implied)
h.linkTo(vars.termStructure)
This gives me the error I mentioned earlier
Thanks,
Anatoly
--
View this message in context: http://quantlib.10058.n7.nabble.com/SWIG-Python-failure-to-register-observer-with-observable-tp15650p15755.html
Sent from the quantlib-users mailing list archive at Nabble.com.
| From: | suhasg <[hidden email]> |
| To: | [hidden email] |
| Subject: | [Quantlib-users] Curve Building with Cubic Spline |
| Date: | Wed, 13 Aug 2014 09:15:44 -0700 (PDT) |
I have modified discountcurve.i SWIG interface to export CubicDiscountCurve, but I am not sure how to use it. We specifically need to use LogCubicNaturalSpline method for interpolation. Can you please give me an example in Python of how to use this interpolation method? I have tried various combinations of following but none have worked. logcubic = LogCubicNaturalSpline(LogCubicNaturalSpline.secondDerivative(LogCubicNaturalSpline(0,0)), LogCubicNaturalSpline.secondDerivative(LogCubicNaturalSpline(0,0)),True) forecastingCurve = CubicDiscountCurve(libordates,disfactors,Actual360(),calendar,logcubic) Also, is there a general way to find out a previous fixing date for LIBOR curve? Our curves are stored in database and I extract settlement date curve points from the database. But when settlement date is between 2 fixing dates, I need to provide the previous fixing date and rate. What is the correct way to derive the last fixing date for different settlement dates? Thank you. -- View this message in context: http://quantlib.10058.n7.nabble.com/Curve-Building-with-Cubic-Spline-tp15756.html Sent from the quantlib-users mailing list archive at Nabble.com.
| From: | Hsiao-nan Cheung <[hidden email]> |
| To: | [hidden email] |
| Subject: | [Quantlib-users] About QuantLib compile with mingw and boost header. |
| Date: | Thu, 14 Aug 2014 08:48:19 +0800 |
| From: | cheng li <[hidden email]> |
| To: | 'Hsiao-nan Cheung' <[hidden email]>; [hidden email] |
| Subject: | [Quantlib-users] 答复: About QuantLib compile with mingw and boost header. |
| Date: | Thu, 14 Aug 2014 10:25:47 +0800 |
| From: | cheng li <[hidden email]> |
| To: | 'suhasg' <[hidden email]>; [hidden email] |
| Subject: | [Quantlib-users] 答复: Curve Building with Cubic Spline |
| Date: | Thu, 14 Aug 2014 10:53:11 +0800 |
Hi suhasg, 1. The function name CubicDiscountCurve has already indicated that the interpolation trais should be set as Cubic. You can’t mess CubicDiscountCurve and LogCubicNaturalSpline together. If you really want to use LogCubic NaturalSpline, you have to do below: a. Add a line “export_discount_curve(LogCubic DiscountCurve, LogCubic);” at the end of discountcurve.i b. change the file interpolation.i accordingly to export LogCubic traits. Be cafeful! you have to do more than other traits since you have to export the constructor of LogCubic. The reason is that currently the default choice of LogCubic traits is MonotonicLogCubicNatural not LogCubicNatural. 2. This problem is simpler than the first one. Historical fixing can be handled by Index method addFixing. You can add specific value on a specific date as historical fixing for that index. Regards, Cheng -----邮件原件----- 发件人: suhasg [[hidden email]] 发送时间: 2014年8月14日 0:16 收件人: [hidden email] 主题: [Quantlib-users] Curve Building with Cubic Spline I have modified discountcurve.i SWIG interface to export CubicDiscountCurve, but I am not sure how to use it. We specifically need to use LogCubicNaturalSpline method for interpolation. Can you please give me an example in Python of how to use this interpolation method? I have tried various combinations of following but none have worked. logcubic = LogCubicNaturalSpline(LogCubicNaturalSpline.secondDerivative(LogCubicNatural Spline(0,0)), LogCubicNaturalSpline.secondDerivative(LogCubicNaturalSpline(0,0)),True) forecastingCurve = CubicDiscountCurve(libordates,disfactors,Actual360(),calendar,logcubic) Also, is there a general way to find out a previous fixing date for LIBOR curve? Our curves are stored in database and I extract settlement date curve points from the database. But when settlement date is between 2 fixing dates, I need to provide the previous fixing date and rate. What is the correct way to derive the last fixing date for different settlement dates? Thank you. -- View this message in context: http://quantlib.10058.n7.nabble.com/Curve-Building-with-Cubic-Spline-tp15756 .html Sent from the quantlib-users mailing list archive at Nabble.com. ---------------------------------------------------------------------------- -- _______________________________________________ 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
| Free forum by Nabble | Edit this page |