You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
(60) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(18) |
Feb
(4) |
Mar
(6) |
Apr
(2) |
May
|
Jun
(12) |
Jul
(48) |
Aug
(6) |
Sep
(3) |
Oct
(24) |
Nov
(15) |
Dec
(18) |
| 2002 |
Jan
(39) |
Feb
(12) |
Mar
(80) |
Apr
(72) |
May
(46) |
Jun
(27) |
Jul
(23) |
Aug
(34) |
Sep
(65) |
Oct
(71) |
Nov
(19) |
Dec
(14) |
| 2003 |
Jan
(44) |
Feb
(59) |
Mar
(18) |
Apr
(62) |
May
(54) |
Jun
(27) |
Jul
(46) |
Aug
(15) |
Sep
(44) |
Oct
(36) |
Nov
(19) |
Dec
(12) |
| 2004 |
Jan
(26) |
Feb
(33) |
Mar
(47) |
Apr
(63) |
May
(36) |
Jun
(65) |
Jul
(80) |
Aug
(163) |
Sep
(65) |
Oct
(39) |
Nov
(36) |
Dec
(39) |
| 2005 |
Jan
(97) |
Feb
(78) |
Mar
(64) |
Apr
(64) |
May
(48) |
Jun
(55) |
Jul
(89) |
Aug
(57) |
Sep
(51) |
Oct
(111) |
Nov
(86) |
Dec
(76) |
| 2006 |
Jan
(84) |
Feb
(103) |
Mar
(143) |
Apr
(92) |
May
(55) |
Jun
(58) |
Jul
(71) |
Aug
(57) |
Sep
(74) |
Oct
(59) |
Nov
(8) |
Dec
(32) |
| 2007 |
Jan
(60) |
Feb
(40) |
Mar
(50) |
Apr
(26) |
May
(61) |
Jun
(120) |
Jul
(119) |
Aug
(48) |
Sep
(121) |
Oct
(66) |
Nov
(103) |
Dec
(43) |
| 2008 |
Jan
(60) |
Feb
(109) |
Mar
(92) |
Apr
(106) |
May
(82) |
Jun
(59) |
Jul
(67) |
Aug
(118) |
Sep
(131) |
Oct
(56) |
Nov
(37) |
Dec
(69) |
| 2009 |
Jan
(75) |
Feb
(76) |
Mar
(103) |
Apr
(78) |
May
(61) |
Jun
(35) |
Jul
(66) |
Aug
(69) |
Sep
(166) |
Oct
(46) |
Nov
(72) |
Dec
(65) |
| 2010 |
Jan
(48) |
Feb
(57) |
Mar
(93) |
Apr
(85) |
May
(123) |
Jun
(82) |
Jul
(98) |
Aug
(121) |
Sep
(146) |
Oct
(86) |
Nov
(72) |
Dec
(34) |
| 2011 |
Jan
(96) |
Feb
(55) |
Mar
(73) |
Apr
(57) |
May
(33) |
Jun
(74) |
Jul
(89) |
Aug
(71) |
Sep
(103) |
Oct
(76) |
Nov
(52) |
Dec
(61) |
| 2012 |
Jan
(48) |
Feb
(54) |
Mar
(78) |
Apr
(60) |
May
(75) |
Jun
(59) |
Jul
(33) |
Aug
(66) |
Sep
(43) |
Oct
(46) |
Nov
(75) |
Dec
(51) |
| 2013 |
Jan
(112) |
Feb
(72) |
Mar
(49) |
Apr
(48) |
May
(42) |
Jun
(44) |
Jul
(80) |
Aug
(19) |
Sep
(33) |
Oct
(37) |
Nov
(38) |
Dec
(98) |
| 2014 |
Jan
(113) |
Feb
(93) |
Mar
(49) |
Apr
(106) |
May
(97) |
Jun
(155) |
Jul
(87) |
Aug
(127) |
Sep
(85) |
Oct
(48) |
Nov
(41) |
Dec
(37) |
| 2015 |
Jan
(34) |
Feb
(50) |
Mar
(104) |
Apr
(80) |
May
(82) |
Jun
(66) |
Jul
(41) |
Aug
(84) |
Sep
(37) |
Oct
(65) |
Nov
(83) |
Dec
(52) |
| 2016 |
Jan
(68) |
Feb
(35) |
Mar
(42) |
Apr
(35) |
May
(54) |
Jun
(75) |
Jul
(45) |
Aug
(52) |
Sep
(60) |
Oct
(52) |
Nov
(36) |
Dec
(64) |
| 2017 |
Jan
(92) |
Feb
(59) |
Mar
(35) |
Apr
(53) |
May
(83) |
Jun
(43) |
Jul
(65) |
Aug
(68) |
Sep
(46) |
Oct
(75) |
Nov
(40) |
Dec
(49) |
| 2018 |
Jan
(68) |
Feb
(54) |
Mar
(48) |
Apr
(58) |
May
(51) |
Jun
(44) |
Jul
(40) |
Aug
(68) |
Sep
(35) |
Oct
(15) |
Nov
(7) |
Dec
(37) |
| 2019 |
Jan
(43) |
Feb
(7) |
Mar
(22) |
Apr
(21) |
May
(31) |
Jun
(39) |
Jul
(73) |
Aug
(45) |
Sep
(47) |
Oct
(89) |
Nov
(19) |
Dec
(69) |
| 2020 |
Jan
(52) |
Feb
(63) |
Mar
(45) |
Apr
(59) |
May
(42) |
Jun
(57) |
Jul
(30) |
Aug
(29) |
Sep
(75) |
Oct
(64) |
Nov
(96) |
Dec
(22) |
| 2021 |
Jan
(14) |
Feb
(24) |
Mar
(35) |
Apr
(58) |
May
(36) |
Jun
(15) |
Jul
(18) |
Aug
(31) |
Sep
(30) |
Oct
(33) |
Nov
(27) |
Dec
(16) |
| 2022 |
Jan
(35) |
Feb
(22) |
Mar
(14) |
Apr
(20) |
May
(44) |
Jun
(53) |
Jul
(25) |
Aug
(56) |
Sep
(11) |
Oct
(47) |
Nov
(22) |
Dec
(36) |
| 2023 |
Jan
(30) |
Feb
(17) |
Mar
(31) |
Apr
(48) |
May
(31) |
Jun
(7) |
Jul
(25) |
Aug
(26) |
Sep
(61) |
Oct
(66) |
Nov
(19) |
Dec
(21) |
| 2024 |
Jan
(37) |
Feb
(29) |
Mar
(26) |
Apr
(26) |
May
(34) |
Jun
(9) |
Jul
(27) |
Aug
(13) |
Sep
(15) |
Oct
(25) |
Nov
(13) |
Dec
(8) |
| 2025 |
Jan
(13) |
Feb
(1) |
Mar
(16) |
Apr
(17) |
May
(8) |
Jun
(6) |
Jul
(9) |
Aug
|
Sep
(6) |
Oct
(15) |
Nov
(6) |
Dec
|
| 2026 |
Jan
(6) |
Feb
(4) |
Mar
(20) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Lasha D. <las...@gm...> - 2022-10-03 13:08:41
|
Hi I Have a problem with QuantLib C# Wrapper,
There is code snippet,
Please help me :)
DateTime date = DateTime.Parse("9/30/2022");
var dSettlementDate = new Date(date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy");
Settings.instance().setEvaluationDate(dSettlementDate);
var spot_dates = new DateVector();
var spot_rates = new DoubleVector();
//spot_dates.Add(new
Date(DateTime.Parse("9/30/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
//spot_rates.Add((double)10.6372 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/01/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.6372 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/2/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.6372 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/8/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.6372 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/15/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.6079 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/31/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.5428 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("12/1/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.4244 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("12/31/2022").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.3189 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("3/31/2023").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.0451 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/1/2023").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)9.6805 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/1/2024").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)9.3918 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/1/2027").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)9.6234 / 100.0);
spot_dates.Add(new
Date(DateTime.Parse("10/1/2032").Date.ToString("dd/MM/yyyy"),
"dd/mm/yyyy"));
spot_rates.Add((double)10.0937 / 100.0);
var curveDayCounter = new Actual365Fixed();
var curveCalendar = new NullCalendar();
var curveInterpolation = new Linear();
var curveCompounding = Compounding.Compounded;
var curveFrquency = Frequency.Semiannual;
var spot_curve = new ZeroCurve(spot_dates, spot_rates,
curveDayCounter, curveCalendar, curveInterpolation, curveCompounding,
curveFrquency);
var spot_curve_handle = new
YieldTermStructureHandle(spot_curve);
var engine = new DiscountingBondEngine(spot_curve_handle);
DateTime startDate = DateTime.Parse("11/18/2021");
DateTime endDate = DateTime.Parse("9/27/2023");
DateTime paymentDate = DateTime.Parse("9/30/2022");
Settings.instance().setEvaluationDate(new
Date(startDate.ToString("dd/MM/yyyy"), "dd/mm/yyyy"));
Calendar calendarQ = new WeekendsOnly();
Frequency frquency = Frequency.Semiannual;
DayCounter dayCounter = new
ActualActual(ActualActual.Convention.ISMA);
Schedule schedule = new Schedule(new
Date(startDate.ToString("dd/MM/yyyy"), "dd/mm/yyyy"),
new
Date(endDate.ToString("dd/MM/yyyy"), "dd/mm/yyyy"),
new Period(frquency),
calendarQ,
BusinessDayConvention.Unadjusted,
BusinessDayConvention.Unadjusted,
DateGeneration.Rule.Backward,
false);
var bond = new FixedRateBond(0, //settlementDays,
100.0,
schedule,
new DoubleVector(1) { 0.07375 },
dayCounter,
BusinessDayConvention.Unadjusted,
100.0
);
bond.setPricingEngine(engine);
Settings.instance().setEvaluationDate(new
Date(paymentDate.ToString("dd/MM/yyyy"), "dd/mm/yyyy"));
var CleanPrice = bond.NPV();
Console.WriteLine(CleanPrice);
|
|
From: <mad...@gm...> - 2022-09-30 09:18:34
|
Hi all, Sorry, I sent the email in HTML format by mistake, so I send the same one in text format. I would like to calibrate G2++ model with some parameters (for example, correlation) fixed at some values. Is this possible by QuantLib Python? I found the similar e-mail in the archives, but I'm not clear and expect some updates in QuantLib Python since the e-mail was sent. Thank you, Kiichi |
|
From: Yamada K. <mad...@gm...> - 2022-09-30 04:52:45
|
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:"Cambria Math"; panose-1:2 4 5 3 5 4 6 3 2 4;} @font-face {font-family:"Yu Gothic"; panose-1:2 11 4 0 0 0 0 0 0 0;} @font-face {font-family:"MS PGothic"; panose-1:2 11 6 0 7 2 5 8 2 4;} @font-face {font-family:"Yu Gothic"; panose-1:2 11 4 0 0 0 0 0 0 0;} @font-face {font-family:"MS PGothic";} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0mm; text-align:justify; text-justify:inter-ideograph; font-size:10.5pt; font-family:"游ゴシック",sans-serif;} .MsoChpDefault {mso-style-type:export-only;} /* Page Definitions */ @page WordSection1 {size:612.0pt 792.0pt; margin:99.25pt 30.0mm 30.0mm 30.0mm;} div.WordSection1 {page:WordSection1;} --></style></head><body lang=JA link=blue vlink="#954F72" style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span lang=EN-US>Hi all,</span></p><p class=MsoNormal><span lang=EN-US>This is my first e-mail.</span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>I would like to calibrate G2++ model with some parameters (for example, correlation) fixed at some values. Is this possible by QuantLib Python?</span></p><p class=MsoNormal><span lang=EN-US>I found the similar e-mail in the archives, but I’m not clear and expect some updates in QuantLib Python since the e-mail was sent.</span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US>Thank you,</span></p><p class=MsoNormal><span lang=EN-US>Kiichi</span><span lang=EN-US style='font-size:12.0pt;font-family:"MS Pゴシック",sans-serif'><o:p></o:p></span></p></div></body></html> |
|
From: Alix L. <ali...@gm...> - 2022-09-23 14:33:54
|
Hi Tom,
Thanks for your feedback. I have made a try with your suggestion, but the
code keeps passing even if I deliberately set quadraticity and monotonicity
parameters to negative values - no exception is thrown, while it should.
I don't know what is going on, I even tried to set these parameters to
negative values in the core library (shifting the default ones in
convexmonotoneinterpolation.hpp), and the same behavior again, the code
passed successfully.
I attached my test file again, I feel like either I am missing something
very simple, or this is far beyond my C++ knowledge...
Best,
Alix
Le jeu. 22 sept. 2022 à 18:41, Tom Anderson <tw...@ur...> a écrit :
> On Wed, 14 Sep 2022, Alix Lassauzet wrote:
>
> > While I was investigating the cause of this kink, I tried to play with
> > the 2 extra parameters, quadraticity and monotonicity, and noticed that
> > if I set abnormal values to these parameters (both negative for
> > example), my code does not throw any exception (while the implementation
> > of the class convexmonotoneinterpolation.hpp suggests the code should
> > fail around L201).
> >
> > I can't figure out what is happening:
> > - is my code correct given that no exception is thrown?
> > - Has anyone already experienced this behavior and how do they fix it?
>
> When you create a PiecewiseYieldCurve, you specify the interpolator in two
> ways: as a constructor parameter, but also as a type parameter. Somewhere
> in the guts of the bootstrap process - i can't find it right now, but i'm
> positive there is such a place - the code creates fresh instances of the
> interpolator directly from the type parameter, using its no-argument
> constructor. For ConvexMonotone, that means it uses the default values for
> the icities and forcePositive, and so ignores the ones you specified when
> you created the instance.
>
> In my code, i have dealt with this by creating a subclass of the
> interpolator which sets these to the values i want, eg:
>
> class PureConvexMonotone : public ConvexMonotone {
> public:
> PureConvexMonotone(Real quadraticity = 0.0, Real monotonicity = 1.0,
> bool forcePositive = false)
> : ConvexMonotone(quadraticity, monotonicity, forcePositive) {}
> };
>
> Then using that as the template parameter.
>
> If you can run your code under a debugger, try putting a breakpoint on the
> constructor, and see where you hit it.
>
> tom
>
> --
> Whatever you do, do the best you can, because the film lives forever. --
> Jackie Chan
>
|
|
From: Tom A. <tw...@ur...> - 2022-09-22 17:12:22
|
On Wed, 14 Sep 2022, Alix Lassauzet wrote:
> While I was investigating the cause of this kink, I tried to play with
> the 2 extra parameters, quadraticity and monotonicity, and noticed that
> if I set abnormal values to these parameters (both negative for
> example), my code does not throw any exception (while the implementation
> of the class convexmonotoneinterpolation.hpp suggests the code should
> fail around L201).
>
> I can't figure out what is happening:
> - is my code correct given that no exception is thrown?
> - Has anyone already experienced this behavior and how do they fix it?
When you create a PiecewiseYieldCurve, you specify the interpolator in two
ways: as a constructor parameter, but also as a type parameter. Somewhere
in the guts of the bootstrap process - i can't find it right now, but i'm
positive there is such a place - the code creates fresh instances of the
interpolator directly from the type parameter, using its no-argument
constructor. For ConvexMonotone, that means it uses the default values for
the icities and forcePositive, and so ignores the ones you specified when
you created the instance.
In my code, i have dealt with this by creating a subclass of the
interpolator which sets these to the values i want, eg:
class PureConvexMonotone : public ConvexMonotone {
public:
PureConvexMonotone(Real quadraticity = 0.0, Real monotonicity = 1.0, bool forcePositive = false)
: ConvexMonotone(quadraticity, monotonicity, forcePositive) {}
};
Then using that as the template parameter.
If you can run your code under a debugger, try putting a breakpoint on the
constructor, and see where you hit it.
tom
--
Whatever you do, do the best you can, because the film lives forever. --
Jackie Chan
|
|
From: Roland L. <rol...@ac...> - 2022-09-22 15:46:00
|
Dear all, we have just published the 7th release of ORE and ORE-SWIG, updating the codebase at https://github.com/OpenSourceRisk. ORE 7 depends on QuantLib 1.27.1 and QuantLib-SWIG 1.27. The release contains many fixes and improvements over the past year that were triggered by our main sponsor’s (Acadia) use of ORE in their Initial Margin Risk Generator services. The full release notes can be found in the user guide under the DOCUMENTATION menu on https://opensourcerisk.org. With this release we have started publishing a wide range of additional financial instruments. You will see various Equity/FX Exotics in this release. Commodity, Credit, Hybrids, Exotics with scripted payoffs will follow in the next releases in quarterly steps, see also the Acadia press release and roadmap here<https://www.acadia.inc/news/acadia-announces-seventh-release-of-open-source-risk-engine-with-quarterly-releases-to-follow>. If you want to hear from Acadia about latest ORE developments, then feel free to sign up here<https://share.hsforms.com/1eqcUZ-9_QdSH__M7_YPSig43ul4> to receive updates by email. Please explore ORE – download the release executable, or clone the repositories and build. As usual, all feedback is welcome! Best regards, Roland The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. If you are not the intended recipient please return the e-mail to the sender and delete it from your computer. The acadia.inc privacy policy is available on our website. |
|
From: Daniel <gr...@gm...> - 2022-09-14 21:59:39
|
Thank you Peter for your explanation. For "coterminal atm strip", is the constant (expiry + tenor) a choice of convenience, or a choice of necessity? Do you have some paper to share? If comparing GSR and G2++, will GSR still be considered a better choice than G2++ since GSR sigma is piecewise constant? Thanks, Mark On Sat, Sep 10, 2022 at 6:04 AM Peter Caspers <pca...@gm...> wrote: > That's good to hear. > > By "option strip" I mean a series of swaptions with strictly ascending > option expiry dates. For example, a "coterminal atm strip" would be an > option strip where option expiry time + underlying tenor = constant > and strike = atm forward. > > The GSR model can be calibrated exactly to such a strip when you > choose the step dates = option strip expiry dates (omitting the last > expiry date) and an exogenous mean reversion. Well, that's not > completely true, especially for rapidly decreasing market vols in > option expiry direction and / or negative mean reversion values, where > the GSR model might overprice longer term options because it has > accumulated too much volatility for shorter options already which it > can not reduce fast enough. But under usual circumstances this works > fine. > > You can even bootstrap the volatility function iterating through the > swaptions of the strip one by one which is often faster than a global > calibration to all swaptions simultaneously. That kind of calibration > is kind of the "minimal standard" in the market to price e.g. Bermudan > swaptions. > > G2++ is still not flexible enough for a global calibration I guess. > For a global calibration you rather want to use e.g. a Libor market > model or a higher dimensional HJM model. To match smiles you'll also > need to consider stochastic vols. > > Thanks > Peter > > > Peter > > On Tue, 30 Aug 2022 at 17:04, Daniel <gr...@gm...> wrote: > > > > Peter, > > > > Thank you for your answer. I tried > Gaussian1dJamshidianSwaptionEngine(model), now I can get the calibrated > model parameters. > > > > My exercise is to calibrate 1F hw model parameter using the whole vol > surface, so I can use it for pricing(such as swaption). Sorry I am not > familiar with option strip, can you elaborate on what is the model > associated with option strip. If 1F HW model is not good to calibrate the > whole vol surface, how about G2++ model? > > > > Thanks, > > Mark > > > > On Sat, Aug 27, 2022 at 7:27 AM Peter Caspers <pca...@gm...> > wrote: > >> > >> Hi Daniel > >> > >> you could use the Gaussian1dJamshidianSwaptionEngine instead of the > >> engine based on numerical integration. However I notice we never added > >> an override for zerobondOption() in the GSR model class, so we'll fall > >> back on the numerical integration implemented in the Gaussian1dModel > >> base class. To be honest, the whole implementation of the "Gaussian1d" > >> - framework was always more geared towards the Markov functional model > >> and the GSR model was more a "trivial by-product". > >> > >> As seen from today I'd rather consolidate the LGM1F model implemented in > >> > >> > https://github.com/OpenSourceRisk/Engine/blob/master/QuantExt/qle/models/lgm.hpp > >> > >> into the core library and use the engines associated with that model. > >> Not sure if I'd deprecate the GSR imlementation, but it duplicates > >> functionality alright and we don't want to maintain both models in the > >> long term. That might not help you immediately, especially since you > >> are using the QuantLib Python wrapper! I still wanted to mention it > >> since that consolidation would make a lot of sense in my opinion. > >> > >> More generally, could you elaborate on what the goal of your exercise > >> is? A Hull White 1F model is not really designed to fit a whole vol > >> matrix, an option strip is really all it can handle well? > >> > >> Finally, since we have Dmitri on this thread, here is a crazy idea: > >> Use his AADC library to tape the slow GSR-pricing of the 13x13 > >> swaptions and then replay the tape during the optimization to speed > >> that up. That might be an interesting case study for the technology? > >> > >> Thanks > >> Peter > >> > >> > >> > >> > >> > >> On Thu, 25 Aug 2022 at 11:10, Daniel <gr...@gm...> wrote: > >> > > >> > Thank you Peter for your information. I overwrote T to 61, now I can > see runtimeError is gone. > >> > > >> > But I had a new issue of very long calibration time now. > >> > I am calibrating a 13 (maturity) x 13 (tenor) volatility surface, and > I am using constant mean reversions and piecewise constant volatility as > below: > >> > stepDates is set at time grid @ [1,2,5,7,10,20] year from the > valuation date > >> > reversions = [ql.QuoteHandle(ql.SimpleQuote(0.0001))] > >> > sigmas = [ql.QuoteHandle(ql.SimpleQuote(0.006)) for i in range(0, > len(stepDates)+1)] > >> > > >> > In order to expedite calibration, I used low optimization criteria > for LM method and end criteria as below. But I tested below code, the code > can solve low dimension volatility surface(which means the code is > working), but it takes already 6 hours and haven't solved 13X13 volatility > surfaces. Any suggestion to calibrate faster? > >> > > >> > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,61); > >> > engine = ql.Gaussian1dSwaptionEngine(model, 64, 7.0, True, False, > term_structure) > >> > swaptions = create_swaption_helpers(data, index, term_structure, > engine) > >> > optimization_method =ql.LevenbergMarquardt(1.0e-2,1.0e-2,1.0e-2) > >> > end_criteria = ql.EndCriteria(1000, 10, 1e-2, 1e-3, 1e-3) > >> > model.calibrate(swaptions, optimization_method, end_criteria) > >> > > >> > Thanks, > >> > Mark > >> > > >> > On Wed, Aug 24, 2022 at 9:36 AM Peter Caspers <pca...@gm...> > wrote: > >> >> > >> >> Hi Daniel > >> >> > >> >> yes you'd change T in the ctor call ql.Gsr(...). > >> >> > >> >> 1. T is the maturity of the zero bond P(0, T) used as a numeraire in > >> >> the T-Forward measure > >> >> 2. years > >> >> 3. slightly higher than 60 I'd think to capture day counter / > >> >> convention / lag effects, maybe 61 is sufficient already > >> >> > >> >> Thanks > >> >> Peter > >> >> > >> >> > >> >> On Wed, 24 Aug 2022 at 11:47, Daniel <gr...@gm...> wrote: > >> >> > > >> >> > Peter, > >> >> > Thank you for your reply. > >> >> > Just want to make sure overwriting T means I should change below > statement > >> >> > model = ql.Gsr(term_structure,stepDates, > sigmas,reversions,T=60); > >> >> > to use some other T value instead, am I right? > >> >> > Two questions: > >> >> > 1. What is the meaning of T here? > >> >> > 2. What is the unit for T (month, year)? > >> >> > 3. If my calibrated swaption has a maximum 30Y x 30Y matrix, what > is the T value I should use? > >> >> > > >> >> > Thanks, > >> >> > Mark > >> >> > > >> >> > > >> >> > On Tue, Aug 23, 2022 at 1:30 PM Peter Caspers < > pca...@gm...> wrote: > >> >> >> > >> >> >> Hi > >> >> >> > >> >> >> the GSR model operates in the T-forward measure with T=60 by > default. You can overwrite T in the constructor if longer horizons are > needed (as it appears to be the case in your setup). > >> >> >> > >> >> >> Best > >> >> >> Peter > >> >> >> > >> >> >> > >> >> >> Daniel <gr...@gm...> schrieb am Mo. 22. Aug. 2022 um 21:25: > >> >> >>> > >> >> >>> Thank you Dmitri for your information. Actually I increased the > vol surface number to more than to be calibration volatility number, now I > can solve for mean reversion and volatility now. > >> >> >>> > >> >> >>> But experience another error when I tried to change the yield > curve and volatility surface to some other type, I got below error. > >> >> >>> > >> >> >>> ---> 14 model.calibrate(swaptions, optimization_method, > end_criteria) > >> >> >>> > >> >> >>> ~\.conda\envs\tf-gpu\lib\site-packages\QuantLib\QuantLib.py in > calibrate(self, *args) > >> >> >>> > >> >> >>> def calibrate(self, *args): > >> >> >>> > return _QuantLib.Gsr_calibrate(self, *args) > >> >> >>> > >> >> >>> def setParams(self, params): > >> >> >>> > >> >> >>> RuntimeError: G(t,w) should be called with > (t,w)=(29.9985,60.0055) in Range [0,60]. > >> >> >>> > >> >> >>> > >> >> >>> What does this runtimeError mean? > >> >> >>> > >> >> >>> > >> >> >>> Thanks, > >> >> >>> > >> >> >>> Mark > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> > >> >> >>> On Mon, Aug 22, 2022 at 12:50 PM Dmitri Goloubentsev < > dm...@ma...> wrote: > >> >> >>>> > >> >> >>>> Hi Mark, > >> >> >>>> > >> >> >>>> > >> >> >>>> The error is coming from LM optimiser. You should reduce number > of points in your vol surface or add more calibration instruments or add > some sort of regularisation. > >> >> >>>> > >> >> >>>> Kind regards, > >> >> >>>> Dmitri. > >> >> >>>> > >> >> >>>> On Mon, 22 Aug 2022, 17:26 Daniel, <gr...@gm...> wrote: > >> >> >>>>> > >> >> >>>>> All, > >> >> >>>>> > >> >> >>>>> Please forgive me if someone has answered a similar question > before. > >> >> >>>>> > >> >> >>>>> I am trying to calibrate interest rate vol surface using GSR > (gaussian short rate model) based on this post > >> >> >>>>> > http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html > >> >> >>>>> > >> >> >>>>> and I found a python example for GSR model calibration. > >> >> >>>>> > https://github.com/mlungwitz/notebooks/blob/master/GSR_Example.ipynb > >> >> >>>>> > >> >> >>>>> What I tried to do is to calibrate the same european swaption > vol surface in the 1st python example based on 2nd example gsr model > specification, what I added is: > >> >> >>>>> gsr = ql.Gsr(term_structure,stepDates, sigmas,reversions); > >> >> >>>>> engine = ql.Gaussian1dSwaptionEngine(gsr, 64, 7.0, True, > False, term_structure) > >> >> >>>>> swaptions = create_swaption_helpers(data, index, > term_structure, engine) > >> >> >>>>> > >> >> >>>>> optimization_method = > ql.LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8) > >> >> >>>>> end_criteria = ql.EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8) > >> >> >>>>> model.calibrate(swaptions, optimization_method, end_criteria) > >> >> >>>>> > >> >> >>>>> But this will give me this error: > >> >> >>>>> > >> >> >>>>> RuntimeError: less functions (5) than available variables (12) > >> >> >>>>> > >> >> >>>>> Is the error caused by Gaussian1dSwaptionEngine? Should I > proceed with Gaussian1dNonstandardSwaptionEngine? What change should I do > to make it work ? > >> >> >>>>> > >> >> >>>>> > >> >> >>>>> Thanks, > >> >> >>>>> > >> >> >>>>> Mark > >> >> >>>>> > >> >> >>>>> _______________________________________________ > >> >> >>>>> QuantLib-users mailing list > >> >> >>>>> Qua...@li... > >> >> >>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > >> >> >>> > >> >> >>> _______________________________________________ > >> >> >>> QuantLib-users mailing list > >> >> >>> Qua...@li... > >> >> >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Alix L. <ali...@gm...> - 2022-09-14 08:38:15
|
Hi QL-community, I am observing a drop in the Euribor 6M curve generated with the enhanced version of the Hagan West interpolation implemented in QuantLib. The drop happens when FRAs instruments are inserted in the bootstrapping. While I was investigating the cause of this kink, I tried to play with the 2 extra parameters, quadraticity and monotonicity, and noticed that if I set abnormal values to these parameters (both negative for example), my code does not throw any exception (while the implementation of the class convexmonotoneinterpolation.hpp suggests the code should fail around L201). I can't figure out what is happening: - is my code correct given that no exception is thrown? - Has anyone already experienced this behavior and how do they fix it? I have attached my C++ code. Thanks, Alix |
|
From: Diego D'A. <die...@gm...> - 2022-09-12 14:58:47
|
All, Is there any example on how to apply a seasonality adjustment to an inflation term structure that has been bootstrapped from Zero Coupon Swaps? I have seen the MultiplicativePriceSeasonality class and I was wondering how I can link that to the inflation term structure. Thanks, Diego [image: width=] <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> Privo di virus.www.avast.com <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail> <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2> |
|
From: Peter C. <pca...@gm...> - 2022-09-10 10:04:29
|
That's good to hear. By "option strip" I mean a series of swaptions with strictly ascending option expiry dates. For example, a "coterminal atm strip" would be an option strip where option expiry time + underlying tenor = constant and strike = atm forward. The GSR model can be calibrated exactly to such a strip when you choose the step dates = option strip expiry dates (omitting the last expiry date) and an exogenous mean reversion. Well, that's not completely true, especially for rapidly decreasing market vols in option expiry direction and / or negative mean reversion values, where the GSR model might overprice longer term options because it has accumulated too much volatility for shorter options already which it can not reduce fast enough. But under usual circumstances this works fine. You can even bootstrap the volatility function iterating through the swaptions of the strip one by one which is often faster than a global calibration to all swaptions simultaneously. That kind of calibration is kind of the "minimal standard" in the market to price e.g. Bermudan swaptions. G2++ is still not flexible enough for a global calibration I guess. For a global calibration you rather want to use e.g. a Libor market model or a higher dimensional HJM model. To match smiles you'll also need to consider stochastic vols. Thanks Peter Peter On Tue, 30 Aug 2022 at 17:04, Daniel <gr...@gm...> wrote: > > Peter, > > Thank you for your answer. I tried Gaussian1dJamshidianSwaptionEngine(model), now I can get the calibrated model parameters. > > My exercise is to calibrate 1F hw model parameter using the whole vol surface, so I can use it for pricing(such as swaption). Sorry I am not familiar with option strip, can you elaborate on what is the model associated with option strip. If 1F HW model is not good to calibrate the whole vol surface, how about G2++ model? > > Thanks, > Mark > > On Sat, Aug 27, 2022 at 7:27 AM Peter Caspers <pca...@gm...> wrote: >> >> Hi Daniel >> >> you could use the Gaussian1dJamshidianSwaptionEngine instead of the >> engine based on numerical integration. However I notice we never added >> an override for zerobondOption() in the GSR model class, so we'll fall >> back on the numerical integration implemented in the Gaussian1dModel >> base class. To be honest, the whole implementation of the "Gaussian1d" >> - framework was always more geared towards the Markov functional model >> and the GSR model was more a "trivial by-product". >> >> As seen from today I'd rather consolidate the LGM1F model implemented in >> >> https://github.com/OpenSourceRisk/Engine/blob/master/QuantExt/qle/models/lgm.hpp >> >> into the core library and use the engines associated with that model. >> Not sure if I'd deprecate the GSR imlementation, but it duplicates >> functionality alright and we don't want to maintain both models in the >> long term. That might not help you immediately, especially since you >> are using the QuantLib Python wrapper! I still wanted to mention it >> since that consolidation would make a lot of sense in my opinion. >> >> More generally, could you elaborate on what the goal of your exercise >> is? A Hull White 1F model is not really designed to fit a whole vol >> matrix, an option strip is really all it can handle well? >> >> Finally, since we have Dmitri on this thread, here is a crazy idea: >> Use his AADC library to tape the slow GSR-pricing of the 13x13 >> swaptions and then replay the tape during the optimization to speed >> that up. That might be an interesting case study for the technology? >> >> Thanks >> Peter >> >> >> >> >> >> On Thu, 25 Aug 2022 at 11:10, Daniel <gr...@gm...> wrote: >> > >> > Thank you Peter for your information. I overwrote T to 61, now I can see runtimeError is gone. >> > >> > But I had a new issue of very long calibration time now. >> > I am calibrating a 13 (maturity) x 13 (tenor) volatility surface, and I am using constant mean reversions and piecewise constant volatility as below: >> > stepDates is set at time grid @ [1,2,5,7,10,20] year from the valuation date >> > reversions = [ql.QuoteHandle(ql.SimpleQuote(0.0001))] >> > sigmas = [ql.QuoteHandle(ql.SimpleQuote(0.006)) for i in range(0, len(stepDates)+1)] >> > >> > In order to expedite calibration, I used low optimization criteria for LM method and end criteria as below. But I tested below code, the code can solve low dimension volatility surface(which means the code is working), but it takes already 6 hours and haven't solved 13X13 volatility surfaces. Any suggestion to calibrate faster? >> > >> > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,61); >> > engine = ql.Gaussian1dSwaptionEngine(model, 64, 7.0, True, False, term_structure) >> > swaptions = create_swaption_helpers(data, index, term_structure, engine) >> > optimization_method =ql.LevenbergMarquardt(1.0e-2,1.0e-2,1.0e-2) >> > end_criteria = ql.EndCriteria(1000, 10, 1e-2, 1e-3, 1e-3) >> > model.calibrate(swaptions, optimization_method, end_criteria) >> > >> > Thanks, >> > Mark >> > >> > On Wed, Aug 24, 2022 at 9:36 AM Peter Caspers <pca...@gm...> wrote: >> >> >> >> Hi Daniel >> >> >> >> yes you'd change T in the ctor call ql.Gsr(...). >> >> >> >> 1. T is the maturity of the zero bond P(0, T) used as a numeraire in >> >> the T-Forward measure >> >> 2. years >> >> 3. slightly higher than 60 I'd think to capture day counter / >> >> convention / lag effects, maybe 61 is sufficient already >> >> >> >> Thanks >> >> Peter >> >> >> >> >> >> On Wed, 24 Aug 2022 at 11:47, Daniel <gr...@gm...> wrote: >> >> > >> >> > Peter, >> >> > Thank you for your reply. >> >> > Just want to make sure overwriting T means I should change below statement >> >> > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,T=60); >> >> > to use some other T value instead, am I right? >> >> > Two questions: >> >> > 1. What is the meaning of T here? >> >> > 2. What is the unit for T (month, year)? >> >> > 3. If my calibrated swaption has a maximum 30Y x 30Y matrix, what is the T value I should use? >> >> > >> >> > Thanks, >> >> > Mark >> >> > >> >> > >> >> > On Tue, Aug 23, 2022 at 1:30 PM Peter Caspers <pca...@gm...> wrote: >> >> >> >> >> >> Hi >> >> >> >> >> >> the GSR model operates in the T-forward measure with T=60 by default. You can overwrite T in the constructor if longer horizons are needed (as it appears to be the case in your setup). >> >> >> >> >> >> Best >> >> >> Peter >> >> >> >> >> >> >> >> >> Daniel <gr...@gm...> schrieb am Mo. 22. Aug. 2022 um 21:25: >> >> >>> >> >> >>> Thank you Dmitri for your information. Actually I increased the vol surface number to more than to be calibration volatility number, now I can solve for mean reversion and volatility now. >> >> >>> >> >> >>> But experience another error when I tried to change the yield curve and volatility surface to some other type, I got below error. >> >> >>> >> >> >>> ---> 14 model.calibrate(swaptions, optimization_method, end_criteria) >> >> >>> >> >> >>> ~\.conda\envs\tf-gpu\lib\site-packages\QuantLib\QuantLib.py in calibrate(self, *args) >> >> >>> >> >> >>> def calibrate(self, *args): >> >> >>> > return _QuantLib.Gsr_calibrate(self, *args) >> >> >>> >> >> >>> def setParams(self, params): >> >> >>> >> >> >>> RuntimeError: G(t,w) should be called with (t,w)=(29.9985,60.0055) in Range [0,60]. >> >> >>> >> >> >>> >> >> >>> What does this runtimeError mean? >> >> >>> >> >> >>> >> >> >>> Thanks, >> >> >>> >> >> >>> Mark >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> >> >> >>> On Mon, Aug 22, 2022 at 12:50 PM Dmitri Goloubentsev <dm...@ma...> wrote: >> >> >>>> >> >> >>>> Hi Mark, >> >> >>>> >> >> >>>> >> >> >>>> The error is coming from LM optimiser. You should reduce number of points in your vol surface or add more calibration instruments or add some sort of regularisation. >> >> >>>> >> >> >>>> Kind regards, >> >> >>>> Dmitri. >> >> >>>> >> >> >>>> On Mon, 22 Aug 2022, 17:26 Daniel, <gr...@gm...> wrote: >> >> >>>>> >> >> >>>>> All, >> >> >>>>> >> >> >>>>> Please forgive me if someone has answered a similar question before. >> >> >>>>> >> >> >>>>> I am trying to calibrate interest rate vol surface using GSR (gaussian short rate model) based on this post >> >> >>>>> http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html >> >> >>>>> >> >> >>>>> and I found a python example for GSR model calibration. >> >> >>>>> https://github.com/mlungwitz/notebooks/blob/master/GSR_Example.ipynb >> >> >>>>> >> >> >>>>> What I tried to do is to calibrate the same european swaption vol surface in the 1st python example based on 2nd example gsr model specification, what I added is: >> >> >>>>> gsr = ql.Gsr(term_structure,stepDates, sigmas,reversions); >> >> >>>>> engine = ql.Gaussian1dSwaptionEngine(gsr, 64, 7.0, True, False, term_structure) >> >> >>>>> swaptions = create_swaption_helpers(data, index, term_structure, engine) >> >> >>>>> >> >> >>>>> optimization_method = ql.LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8) >> >> >>>>> end_criteria = ql.EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8) >> >> >>>>> model.calibrate(swaptions, optimization_method, end_criteria) >> >> >>>>> >> >> >>>>> But this will give me this error: >> >> >>>>> >> >> >>>>> RuntimeError: less functions (5) than available variables (12) >> >> >>>>> >> >> >>>>> Is the error caused by Gaussian1dSwaptionEngine? Should I proceed with Gaussian1dNonstandardSwaptionEngine? What change should I do to make it work ? >> >> >>>>> >> >> >>>>> >> >> >>>>> Thanks, >> >> >>>>> >> >> >>>>> Mark >> >> >>>>> >> >> >>>>> _______________________________________________ >> >> >>>>> QuantLib-users mailing list >> >> >>>>> Qua...@li... >> >> >>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> >>> >> >> >>> _______________________________________________ >> >> >>> QuantLib-users mailing list >> >> >>> Qua...@li... >> >> >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Daniel <gr...@gm...> - 2022-08-30 15:04:45
|
Peter, Thank you for your answer. I tried Gaussian1dJamshidianSwaptionEngine(model), now I can get the calibrated model parameters. My exercise is to calibrate 1F hw model parameter using the whole vol surface, so I can use it for pricing(such as swaption). Sorry I am not familiar with option strip, can you elaborate on what is the model associated with option strip. If 1F HW model is not good to calibrate the whole vol surface, how about G2++ model? Thanks, Mark On Sat, Aug 27, 2022 at 7:27 AM Peter Caspers <pca...@gm...> wrote: > Hi Daniel > > you could use the Gaussian1dJamshidianSwaptionEngine instead of the > engine based on numerical integration. However I notice we never added > an override for zerobondOption() in the GSR model class, so we'll fall > back on the numerical integration implemented in the Gaussian1dModel > base class. To be honest, the whole implementation of the "Gaussian1d" > - framework was always more geared towards the Markov functional model > and the GSR model was more a "trivial by-product". > > As seen from today I'd rather consolidate the LGM1F model implemented in > > > https://github.com/OpenSourceRisk/Engine/blob/master/QuantExt/qle/models/lgm.hpp > > into the core library and use the engines associated with that model. > Not sure if I'd deprecate the GSR imlementation, but it duplicates > functionality alright and we don't want to maintain both models in the > long term. That might not help you immediately, especially since you > are using the QuantLib Python wrapper! I still wanted to mention it > since that consolidation would make a lot of sense in my opinion. > > More generally, could you elaborate on what the goal of your exercise > is? A Hull White 1F model is not really designed to fit a whole vol > matrix, an option strip is really all it can handle well? > > Finally, since we have Dmitri on this thread, here is a crazy idea: > Use his AADC library to tape the slow GSR-pricing of the 13x13 > swaptions and then replay the tape during the optimization to speed > that up. That might be an interesting case study for the technology? > > Thanks > Peter > > > > > > On Thu, 25 Aug 2022 at 11:10, Daniel <gr...@gm...> wrote: > > > > Thank you Peter for your information. I overwrote T to 61, now I can see > runtimeError is gone. > > > > But I had a new issue of very long calibration time now. > > I am calibrating a 13 (maturity) x 13 (tenor) volatility surface, and I > am using constant mean reversions and piecewise constant volatility as > below: > > stepDates is set at time grid @ [1,2,5,7,10,20] year from the valuation > date > > reversions = [ql.QuoteHandle(ql.SimpleQuote(0.0001))] > > sigmas = [ql.QuoteHandle(ql.SimpleQuote(0.006)) for i in range(0, > len(stepDates)+1)] > > > > In order to expedite calibration, I used low optimization criteria for > LM method and end criteria as below. But I tested below code, the code can > solve low dimension volatility surface(which means the code is working), > but it takes already 6 hours and haven't solved 13X13 volatility surfaces. > Any suggestion to calibrate faster? > > > > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,61); > > engine = ql.Gaussian1dSwaptionEngine(model, 64, 7.0, True, False, > term_structure) > > swaptions = create_swaption_helpers(data, index, term_structure, engine) > > optimization_method =ql.LevenbergMarquardt(1.0e-2,1.0e-2,1.0e-2) > > end_criteria = ql.EndCriteria(1000, 10, 1e-2, 1e-3, 1e-3) > > model.calibrate(swaptions, optimization_method, end_criteria) > > > > Thanks, > > Mark > > > > On Wed, Aug 24, 2022 at 9:36 AM Peter Caspers <pca...@gm...> > wrote: > >> > >> Hi Daniel > >> > >> yes you'd change T in the ctor call ql.Gsr(...). > >> > >> 1. T is the maturity of the zero bond P(0, T) used as a numeraire in > >> the T-Forward measure > >> 2. years > >> 3. slightly higher than 60 I'd think to capture day counter / > >> convention / lag effects, maybe 61 is sufficient already > >> > >> Thanks > >> Peter > >> > >> > >> On Wed, 24 Aug 2022 at 11:47, Daniel <gr...@gm...> wrote: > >> > > >> > Peter, > >> > Thank you for your reply. > >> > Just want to make sure overwriting T means I should change below > statement > >> > model = ql.Gsr(term_structure,stepDates, > sigmas,reversions,T=60); > >> > to use some other T value instead, am I right? > >> > Two questions: > >> > 1. What is the meaning of T here? > >> > 2. What is the unit for T (month, year)? > >> > 3. If my calibrated swaption has a maximum 30Y x 30Y matrix, what is > the T value I should use? > >> > > >> > Thanks, > >> > Mark > >> > > >> > > >> > On Tue, Aug 23, 2022 at 1:30 PM Peter Caspers <pca...@gm...> > wrote: > >> >> > >> >> Hi > >> >> > >> >> the GSR model operates in the T-forward measure with T=60 by > default. You can overwrite T in the constructor if longer horizons are > needed (as it appears to be the case in your setup). > >> >> > >> >> Best > >> >> Peter > >> >> > >> >> > >> >> Daniel <gr...@gm...> schrieb am Mo. 22. Aug. 2022 um 21:25: > >> >>> > >> >>> Thank you Dmitri for your information. Actually I increased the vol > surface number to more than to be calibration volatility number, now I can > solve for mean reversion and volatility now. > >> >>> > >> >>> But experience another error when I tried to change the yield > curve and volatility surface to some other type, I got below error. > >> >>> > >> >>> ---> 14 model.calibrate(swaptions, optimization_method, > end_criteria) > >> >>> > >> >>> ~\.conda\envs\tf-gpu\lib\site-packages\QuantLib\QuantLib.py in > calibrate(self, *args) > >> >>> > >> >>> def calibrate(self, *args): > >> >>> > return _QuantLib.Gsr_calibrate(self, *args) > >> >>> > >> >>> def setParams(self, params): > >> >>> > >> >>> RuntimeError: G(t,w) should be called with (t,w)=(29.9985,60.0055) > in Range [0,60]. > >> >>> > >> >>> > >> >>> What does this runtimeError mean? > >> >>> > >> >>> > >> >>> Thanks, > >> >>> > >> >>> Mark > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> > >> >>> On Mon, Aug 22, 2022 at 12:50 PM Dmitri Goloubentsev < > dm...@ma...> wrote: > >> >>>> > >> >>>> Hi Mark, > >> >>>> > >> >>>> > >> >>>> The error is coming from LM optimiser. You should reduce number of > points in your vol surface or add more calibration instruments or add some > sort of regularisation. > >> >>>> > >> >>>> Kind regards, > >> >>>> Dmitri. > >> >>>> > >> >>>> On Mon, 22 Aug 2022, 17:26 Daniel, <gr...@gm...> wrote: > >> >>>>> > >> >>>>> All, > >> >>>>> > >> >>>>> Please forgive me if someone has answered a similar question > before. > >> >>>>> > >> >>>>> I am trying to calibrate interest rate vol surface using GSR > (gaussian short rate model) based on this post > >> >>>>> > http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html > >> >>>>> > >> >>>>> and I found a python example for GSR model calibration. > >> >>>>> > https://github.com/mlungwitz/notebooks/blob/master/GSR_Example.ipynb > >> >>>>> > >> >>>>> What I tried to do is to calibrate the same european swaption vol > surface in the 1st python example based on 2nd example gsr model > specification, what I added is: > >> >>>>> gsr = ql.Gsr(term_structure,stepDates, sigmas,reversions); > >> >>>>> engine = ql.Gaussian1dSwaptionEngine(gsr, 64, 7.0, True, False, > term_structure) > >> >>>>> swaptions = create_swaption_helpers(data, index, term_structure, > engine) > >> >>>>> > >> >>>>> optimization_method = ql.LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8) > >> >>>>> end_criteria = ql.EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8) > >> >>>>> model.calibrate(swaptions, optimization_method, end_criteria) > >> >>>>> > >> >>>>> But this will give me this error: > >> >>>>> > >> >>>>> RuntimeError: less functions (5) than available variables (12) > >> >>>>> > >> >>>>> Is the error caused by Gaussian1dSwaptionEngine? Should I proceed > with Gaussian1dNonstandardSwaptionEngine? What change should I do to make > it work ? > >> >>>>> > >> >>>>> > >> >>>>> Thanks, > >> >>>>> > >> >>>>> Mark > >> >>>>> > >> >>>>> _______________________________________________ > >> >>>>> QuantLib-users mailing list > >> >>>>> Qua...@li... > >> >>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > >> >>> > >> >>> _______________________________________________ > >> >>> QuantLib-users mailing list > >> >>> Qua...@li... > >> >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Francois B. <ig...@gm...> - 2022-08-30 09:08:06
|
Hi Alan, I also had a look at https://github.com/lcallenbach/quantlibaddin . It uses a different approach to configure and generate the C++ code than the original QuantLibAddin repository (which uses .xml files). I managed to build the add-in on Windows and got it working in LibreOffice, but it lacks many of the classes, types and enumerations that I normally work with, so it would be unsuitable for my use, but I can see how it can be extended easily. It also seems that all parameters for the QL* functions are compulsory, even the object ID for the instantiated object. This is a deal-breaker for me, but the novel code generation approach does intrigue me. It's a pity the author doesn't respond and that it looks like the project has stalled. [image: image.png] regards Francois Botha On Thu, 25 Aug 2022 at 17:58, Eric Ehlers <eri...@re...> wrote: > Hello, > > The last version of QuantLibAddin that supported the Calc addin was 1.0.1, > released in 2010. You could try downloading that and following the > documentation which came with it but I wouldn't hold out much hope because > LibreOffice has probably moved on since then. > > At the link you provided it looks like somebody managed to get it working > more recently but I don't know anything about that. Maybe somebody else > will chime in with more info. Sorry that I can't be more helpful. > > Regards, > Eric > On 25/08/2022 13:01, Alan teixeira nicacio de messias Nicacio via > QuantLib-users wrote: > > Hello. I've been studying QuantLib C++ library for some months. Recently > I got interested in knowing and using the LibreOffice Calc export, I tried > to follow the instructions described at > github.com/lcallenbach/quantlibaddin but I didn't totally understand the *code > compilation* section (I'm a mathematician, novice to software > development). I tried to contact the address *lcallenbach@de*, but had no > success. Since the information on internet is scarce and old, I decided to > post on this list. In the following I'll just explain what I already did > and what I wasn't able to do. > > My configurations: Windows 10 64-bit, MVSC C++ compiler, latest Anaconda3 > (with Python 3.9), Linux shell for windows (Ubuntu 20.04.4 LTS), > LibbreOffice 7.4. > > *Code generation*: In 'gensrc' folder I executed on Anaconda3 Powershell > the command '*python main.py -o*', it ran without problems and generated > some c++ source files and a .idl file in 'Calc' folder. > > *Code compilation*: > In 'Calc' folder I edited the file 'environment.sh'. I inserted the three > respective address according to my system (I just wrote the address and > save the changes). In the guide it says " In order to compile the files > generated you have to include the path variables (e.g. execute '. > environment.sh' under Gnu/Linux-bash ". Here I have a question: the only > 'environment.sh' I see in 'Calc' folder is the one I just edited, when I > execute it in the Ubuntu shell it does nothing (what is normal since there > are only path descriptions in that file). What am I doing wrong? > > In the sequence it says " Include the LibreOffice SDK development setup > to your path (e.g. execute '. ~/libreoffice/sdk/setsdkenv_unix.sh' under > Gnu/Linux-bash) ". In my case I executed the 'setsdkenv_windows.bat' > which just asked some directories and then created a new > 'setsdkenv_windows.bat' in user's home directory, all as described on the > LibreOffice installation guide page api.libreoffice.org/docs/install.html > . > > Now it says " If both paths are set call 'make' ". Question: Does "to be > set" mean '. environment.sh' and 'setsdkenv_windows.bat' executed as > described in the guide? If yes they are already set, if not what does it > mean so? Supposing the paths are set, where do I have to call 'make'? On > which directory?, on which prompt (Anaconda, cmd, bash)? Would 'make' mean > 'Makefile'? > > Finally the guide ends with " If you have used the auto-installation > feature of the LibreOffice SDK nothing else has to be done. You can open > the test sheet 'Examples.ods' by executing 'soffice path/Examples.ods' ". > I think that I used the auto-installation feature of the LibreOffice > (didn't I?). What does 'soffice path' mean? on which prompt do I execute 'soffice > path/Examples.ods' (Anaconda, cmd, bash)? > > I'll really appreciate if somebody could help me here or indicate where I > can find help. > > Regards. > > > > _______________________________________________ > QuantLib-users mailing lis...@li...://lists.sourceforge.net/lists/listinfo/quantlib-users > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Luigi B. <lui...@gm...> - 2022-08-30 07:29:38
|
QuantLib 1.27.1 has been released and is available for download at < https://www.quantlib.org/download.shtml>. The list of changes for this release is at < https://www.quantlib.org/reference/history.html>. Please report any problems you have with this release to the QuantLib mailing list (<qua...@li...>), or open a GitHub issue at <https://github.com/lballabio/quantlib/issues>. |
|
From: Victoria T. <vic...@we...> - 2022-08-29 13:01:04
|
Hello,
We are pricing interest rates swaps using quantlib in python.
In our code, we construct the helpers for the discount curve as following:
OIS_Helpers = []
for i in range(1, len(Sliced_Data) + 1):
OIS_Rate = ql.QuoteHandle(ql.SimpleQuote(Sliced_Data["EUREST"][i -
1] / 100))
Maturity_Date_OIS = Calendar.advance(Spot_Date,
ql.Period(Sliced_Data.index[i - 1]))
OIS_Helpers.append(ql.DatedOISRateHelper(Spot_Date,
Maturity_Date_OIS, OIS_Rate, OIS_Index))
With Sliced Data being the inputs fixed swap rates *from 2Y* to 50Y.
Then we build the OIS discounting curve as following:
Disc_Curve = ql.YieldTermStructureHandle(ql.PiecewiseLogLinearDiscount(Spot_Date,
OIS_Helpers, Float_DC))
And we use it in the rest of the code, which returns correct prices for
Swaps beginning at spot date and finishing in 2y, 5y, 10y,etc.
We are very happy with the results, but we are wondering how the
discounting OIS curve is actually built, *since we didn't provide the
algorithm with fixed swap rates for 3m, 6m, 9m, 12m, 15m, 18m, 21m (all the
quarters before 2y)*.
How can it uses the bootstrapping method without these rates?
Are the functions ql.DatedOISRateHelper and/or
ql.YieldTermStructureHandle(ql.PiecewiseLogLinearDiscount) supposing that
the curve is flat before 2y, taking the same base rate as 2y for 3m,
6m,...until 21m?
Many thanks in advance.
|
|
From: Peter C. <pca...@gm...> - 2022-08-27 11:27:35
|
Hi Daniel you could use the Gaussian1dJamshidianSwaptionEngine instead of the engine based on numerical integration. However I notice we never added an override for zerobondOption() in the GSR model class, so we'll fall back on the numerical integration implemented in the Gaussian1dModel base class. To be honest, the whole implementation of the "Gaussian1d" - framework was always more geared towards the Markov functional model and the GSR model was more a "trivial by-product". As seen from today I'd rather consolidate the LGM1F model implemented in https://github.com/OpenSourceRisk/Engine/blob/master/QuantExt/qle/models/lgm.hpp into the core library and use the engines associated with that model. Not sure if I'd deprecate the GSR imlementation, but it duplicates functionality alright and we don't want to maintain both models in the long term. That might not help you immediately, especially since you are using the QuantLib Python wrapper! I still wanted to mention it since that consolidation would make a lot of sense in my opinion. More generally, could you elaborate on what the goal of your exercise is? A Hull White 1F model is not really designed to fit a whole vol matrix, an option strip is really all it can handle well? Finally, since we have Dmitri on this thread, here is a crazy idea: Use his AADC library to tape the slow GSR-pricing of the 13x13 swaptions and then replay the tape during the optimization to speed that up. That might be an interesting case study for the technology? Thanks Peter On Thu, 25 Aug 2022 at 11:10, Daniel <gr...@gm...> wrote: > > Thank you Peter for your information. I overwrote T to 61, now I can see runtimeError is gone. > > But I had a new issue of very long calibration time now. > I am calibrating a 13 (maturity) x 13 (tenor) volatility surface, and I am using constant mean reversions and piecewise constant volatility as below: > stepDates is set at time grid @ [1,2,5,7,10,20] year from the valuation date > reversions = [ql.QuoteHandle(ql.SimpleQuote(0.0001))] > sigmas = [ql.QuoteHandle(ql.SimpleQuote(0.006)) for i in range(0, len(stepDates)+1)] > > In order to expedite calibration, I used low optimization criteria for LM method and end criteria as below. But I tested below code, the code can solve low dimension volatility surface(which means the code is working), but it takes already 6 hours and haven't solved 13X13 volatility surfaces. Any suggestion to calibrate faster? > > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,61); > engine = ql.Gaussian1dSwaptionEngine(model, 64, 7.0, True, False, term_structure) > swaptions = create_swaption_helpers(data, index, term_structure, engine) > optimization_method =ql.LevenbergMarquardt(1.0e-2,1.0e-2,1.0e-2) > end_criteria = ql.EndCriteria(1000, 10, 1e-2, 1e-3, 1e-3) > model.calibrate(swaptions, optimization_method, end_criteria) > > Thanks, > Mark > > On Wed, Aug 24, 2022 at 9:36 AM Peter Caspers <pca...@gm...> wrote: >> >> Hi Daniel >> >> yes you'd change T in the ctor call ql.Gsr(...). >> >> 1. T is the maturity of the zero bond P(0, T) used as a numeraire in >> the T-Forward measure >> 2. years >> 3. slightly higher than 60 I'd think to capture day counter / >> convention / lag effects, maybe 61 is sufficient already >> >> Thanks >> Peter >> >> >> On Wed, 24 Aug 2022 at 11:47, Daniel <gr...@gm...> wrote: >> > >> > Peter, >> > Thank you for your reply. >> > Just want to make sure overwriting T means I should change below statement >> > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,T=60); >> > to use some other T value instead, am I right? >> > Two questions: >> > 1. What is the meaning of T here? >> > 2. What is the unit for T (month, year)? >> > 3. If my calibrated swaption has a maximum 30Y x 30Y matrix, what is the T value I should use? >> > >> > Thanks, >> > Mark >> > >> > >> > On Tue, Aug 23, 2022 at 1:30 PM Peter Caspers <pca...@gm...> wrote: >> >> >> >> Hi >> >> >> >> the GSR model operates in the T-forward measure with T=60 by default. You can overwrite T in the constructor if longer horizons are needed (as it appears to be the case in your setup). >> >> >> >> Best >> >> Peter >> >> >> >> >> >> Daniel <gr...@gm...> schrieb am Mo. 22. Aug. 2022 um 21:25: >> >>> >> >>> Thank you Dmitri for your information. Actually I increased the vol surface number to more than to be calibration volatility number, now I can solve for mean reversion and volatility now. >> >>> >> >>> But experience another error when I tried to change the yield curve and volatility surface to some other type, I got below error. >> >>> >> >>> ---> 14 model.calibrate(swaptions, optimization_method, end_criteria) >> >>> >> >>> ~\.conda\envs\tf-gpu\lib\site-packages\QuantLib\QuantLib.py in calibrate(self, *args) >> >>> >> >>> def calibrate(self, *args): >> >>> > return _QuantLib.Gsr_calibrate(self, *args) >> >>> >> >>> def setParams(self, params): >> >>> >> >>> RuntimeError: G(t,w) should be called with (t,w)=(29.9985,60.0055) in Range [0,60]. >> >>> >> >>> >> >>> What does this runtimeError mean? >> >>> >> >>> >> >>> Thanks, >> >>> >> >>> Mark >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> >> >>> On Mon, Aug 22, 2022 at 12:50 PM Dmitri Goloubentsev <dm...@ma...> wrote: >> >>>> >> >>>> Hi Mark, >> >>>> >> >>>> >> >>>> The error is coming from LM optimiser. You should reduce number of points in your vol surface or add more calibration instruments or add some sort of regularisation. >> >>>> >> >>>> Kind regards, >> >>>> Dmitri. >> >>>> >> >>>> On Mon, 22 Aug 2022, 17:26 Daniel, <gr...@gm...> wrote: >> >>>>> >> >>>>> All, >> >>>>> >> >>>>> Please forgive me if someone has answered a similar question before. >> >>>>> >> >>>>> I am trying to calibrate interest rate vol surface using GSR (gaussian short rate model) based on this post >> >>>>> http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html >> >>>>> >> >>>>> and I found a python example for GSR model calibration. >> >>>>> https://github.com/mlungwitz/notebooks/blob/master/GSR_Example.ipynb >> >>>>> >> >>>>> What I tried to do is to calibrate the same european swaption vol surface in the 1st python example based on 2nd example gsr model specification, what I added is: >> >>>>> gsr = ql.Gsr(term_structure,stepDates, sigmas,reversions); >> >>>>> engine = ql.Gaussian1dSwaptionEngine(gsr, 64, 7.0, True, False, term_structure) >> >>>>> swaptions = create_swaption_helpers(data, index, term_structure, engine) >> >>>>> >> >>>>> optimization_method = ql.LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8) >> >>>>> end_criteria = ql.EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8) >> >>>>> model.calibrate(swaptions, optimization_method, end_criteria) >> >>>>> >> >>>>> But this will give me this error: >> >>>>> >> >>>>> RuntimeError: less functions (5) than available variables (12) >> >>>>> >> >>>>> Is the error caused by Gaussian1dSwaptionEngine? Should I proceed with Gaussian1dNonstandardSwaptionEngine? What change should I do to make it work ? >> >>>>> >> >>>>> >> >>>>> Thanks, >> >>>>> >> >>>>> Mark >> >>>>> >> >>>>> _______________________________________________ >> >>>>> QuantLib-users mailing list >> >>>>> Qua...@li... >> >>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >>> >> >>> _______________________________________________ >> >>> QuantLib-users mailing list >> >>> Qua...@li... >> >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Eric E. <eri...@re...> - 2022-08-25 15:55:27
|
Hello, The last version of QuantLibAddin that supported the Calc addin was 1.0.1, released in 2010. You could try downloading that and following the documentation which came with it but I wouldn't hold out much hope because LibreOffice has probably moved on since then. At the link you provided it looks like somebody managed to get it working more recently but I don't know anything about that. Maybe somebody else will chime in with more info. Sorry that I can't be more helpful. Regards, Eric On 25/08/2022 13:01, Alan teixeira nicacio de messias Nicacio via QuantLib-users wrote: > Hello. I've been studying QuantLib C++ library for some months. > Recently I got interested in knowing and using the LibreOffice Calc > export, I tried to follow the instructions described at > github.com/lcallenbach/quantlibaddin > <https://github.com/lcallenbach/quantlibaddin> but I didn't totally > understand the *code compilation* section (I'm a mathematician, novice > to software development). I tried to contact the address > *lcallenbach@de*,**but**had no success. Since the information on > internet is scarce and old, I decided to post on this list. In the > following I'll just explain what I already did and what I wasn't able > to do. > > My configurations: Windows 10 64-bit, MVSC C++ compiler, latest > Anaconda3 (with Python 3.9), Linux shell for windows (Ubuntu 20.04.4 > LTS), LibbreOffice 7.4. > > *Code generation*: In 'gensrc' folder I executed on Anaconda3 > Powershell the command '/python main.py -o/', it ran without problems > and generated some c++ source files and a .idl file in 'Calc' folder. > > *Code compilation*: > In 'Calc' folder I edited the file 'environment.sh'. I inserted the > three respective address according to my system (I just wrote the > address and save the changes). In the guide it says " In order to > compile the files generated you have to include the path variables > (e.g. execute '. environment.sh' under Gnu/Linux-bash ". Here I have a > question: the only 'environment.sh' I see in 'Calc' folder is the one > I just edited, when I execute it in the Ubuntu shell it does nothing > (what is normal since there are only path descriptions in that file). > What am I doing wrong? > > In the sequence it says " Include the LibreOffice SDK development > setup to your path (e.g. execute '. > ~/libreoffice/sdk/setsdkenv_unix.sh' under Gnu/Linux-bash) ". In my > case I executed the 'setsdkenv_windows.bat' which just asked some > directories and then created a new 'setsdkenv_windows.bat' in user's > home directory, all as described on the LibreOffice installation guide > page api.libreoffice.org/docs/install.html > <https://api.libreoffice.org/docs/install.html>. > > Now it says " If both paths are set call 'make' ". Question: Does "to > be set" mean '. environment.sh' and 'setsdkenv_windows.bat' executed > as described in the guide? If yes they are already set, if not what > does it mean so? Supposing the paths are set, where do I have to call > 'make'? On which directory?, on which prompt (Anaconda, cmd, bash)? > Would 'make' mean 'Makefile'? > > Finally the guide ends with " If you have used the auto-installation > feature of the LibreOffice SDK nothing else has to be done. You can > open the test sheet 'Examples.ods' by executing 'soffice > path/Examples.ods' ". I think that I used the auto-installation > feature of the LibreOffice (didn't I?). What does 'soffice path' mean? > on which prompt do I execute 'soffice path/Examples.ods' (Anaconda, > cmd, bash)? > > I'll really appreciate if somebody could help me here or indicate > where I can find help. > > Regards. > > > > _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users |
|
From: Alan t. n. de m. N. <ala...@ya...> - 2022-08-25 11:01:31
|
Hello. I've been studying QuantLib C++ library for some months. Recently I got interested in knowing and using the LibreOffice Calc export, I tried to follow the instructions described at github.com/lcallenbach/quantlibaddin but I didn't totally understand the code compilation section (I'm a mathematician, novice to software development). I tried to contact the address lcallenbach@de, but had no success. Since the information on internet is scarce and old, I decided to post on this list. In the following I'll just explain what I already did and what I wasn't able to do. My configurations: Windows 10 64-bit, MVSC C++ compiler, latest Anaconda3 (with Python 3.9), Linux shell for windows (Ubuntu 20.04.4 LTS), LibbreOffice 7.4. Code generation: In 'gensrc' folder I executed on Anaconda3 Powershell the command 'python main.py -o', it ran without problems and generated some c++ source files and a .idl file in 'Calc' folder. Code compilation: In 'Calc' folder I edited the file 'environment.sh'. I inserted the three respective address according to my system (I just wrote the address and save the changes). In the guide it says " In order to compile the files generated you have to include the path variables (e.g. execute '. environment.sh' under Gnu/Linux-bash ". Here I have a question: the only 'environment.sh' I see in 'Calc' folder is the one I just edited, when I execute it in the Ubuntu shell it does nothing (what is normal since there are only path descriptions in that file). What am I doing wrong? In the sequence it says " Include the LibreOffice SDK development setup to your path (e.g. execute '. ~/libreoffice/sdk/setsdkenv_unix.sh' under Gnu/Linux-bash) ". In my case I executed the 'setsdkenv_windows.bat' which just asked some directories and then created a new 'setsdkenv_windows.bat' in user's home directory, all as described on the LibreOffice installation guide page api.libreoffice.org/docs/install.html. Now it says " If both paths are set call 'make' ". Question: Does "to be set" mean '. environment.sh' and 'setsdkenv_windows.bat' executed as described in the guide? If yes they are already set, if not what does it mean so? Supposing the paths are set, where do I have to call 'make'? On which directory?, on which prompt (Anaconda, cmd, bash)? Would 'make' mean 'Makefile'? Finally the guide ends with " If you have used the auto-installation feature of the LibreOffice SDK nothing else has to be done. You can open the test sheet 'Examples.ods' by executing 'soffice path/Examples.ods' ". I think that I used the auto-installation feature of the LibreOffice (didn't I?). What does 'soffice path' mean? on which prompt do I execute 'soffice path/Examples.ods' (Anaconda, cmd, bash)? I'll really appreciate if somebody could help me here or indicate where I can find help. Regards. |
|
From: Daniel <gr...@gm...> - 2022-08-25 09:10:34
|
Thank you Peter for your information. I overwrote T to 61, now I can see runtimeError is gone. But I had a new issue of very long calibration time now. I am calibrating a 13 (maturity) x 13 (tenor) volatility surface, and I am using constant mean reversions and piecewise constant volatility as below: stepDates is set at time grid @ [1,2,5,7,10,20] year from the valuation date reversions = [ql.QuoteHandle(ql.SimpleQuote(0.0001))] sigmas = [ql.QuoteHandle(ql.SimpleQuote(0.006)) for i in range(0, len(stepDates)+1)] In order to expedite calibration, I used low optimization criteria for LM method and end criteria as below. But I tested below code, the code can solve low dimension volatility surface(which means the code is working), but it takes already 6 hours and haven't solved 13X13 volatility surfaces. Any suggestion to calibrate faster? model = ql.Gsr(term_structure,stepDates, sigmas,reversions,61); engine = ql.Gaussian1dSwaptionEngine(model, 64, 7.0, True, False, term_structure) swaptions = create_swaption_helpers(data, index, term_structure, engine) optimization_method =ql.LevenbergMarquardt(1.0e-2,1.0e-2,1.0e-2) end_criteria = ql.EndCriteria(1000, 10, 1e-2, 1e-3, 1e-3) model.calibrate(swaptions, optimization_method, end_criteria) Thanks, Mark On Wed, Aug 24, 2022 at 9:36 AM Peter Caspers <pca...@gm...> wrote: > Hi Daniel > > yes you'd change T in the ctor call ql.Gsr(...). > > 1. T is the maturity of the zero bond P(0, T) used as a numeraire in > the T-Forward measure > 2. years > 3. slightly higher than 60 I'd think to capture day counter / > convention / lag effects, maybe 61 is sufficient already > > Thanks > Peter > > > On Wed, 24 Aug 2022 at 11:47, Daniel <gr...@gm...> wrote: > > > > Peter, > > Thank you for your reply. > > Just want to make sure overwriting T means I should change below > statement > > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,T=60); > > to use some other T value instead, am I right? > > Two questions: > > 1. What is the meaning of T here? > > 2. What is the unit for T (month, year)? > > 3. If my calibrated swaption has a maximum 30Y x 30Y matrix, what is the > T value I should use? > > > > Thanks, > > Mark > > > > > > On Tue, Aug 23, 2022 at 1:30 PM Peter Caspers <pca...@gm...> > wrote: > >> > >> Hi > >> > >> the GSR model operates in the T-forward measure with T=60 by default. > You can overwrite T in the constructor if longer horizons are needed (as it > appears to be the case in your setup). > >> > >> Best > >> Peter > >> > >> > >> Daniel <gr...@gm...> schrieb am Mo. 22. Aug. 2022 um 21:25: > >>> > >>> Thank you Dmitri for your information. Actually I increased the vol > surface number to more than to be calibration volatility number, now I can > solve for mean reversion and volatility now. > >>> > >>> But experience another error when I tried to change the yield curve > and volatility surface to some other type, I got below error. > >>> > >>> ---> 14 model.calibrate(swaptions, optimization_method, end_criteria) > >>> > >>> ~\.conda\envs\tf-gpu\lib\site-packages\QuantLib\QuantLib.py in > calibrate(self, *args) > >>> > >>> def calibrate(self, *args): > >>> > return _QuantLib.Gsr_calibrate(self, *args) > >>> > >>> def setParams(self, params): > >>> > >>> RuntimeError: G(t,w) should be called with (t,w)=(29.9985,60.0055) in > Range [0,60]. > >>> > >>> > >>> What does this runtimeError mean? > >>> > >>> > >>> Thanks, > >>> > >>> Mark > >>> > >>> > >>> > >>> > >>> > >>> > >>> On Mon, Aug 22, 2022 at 12:50 PM Dmitri Goloubentsev < > dm...@ma...> wrote: > >>>> > >>>> Hi Mark, > >>>> > >>>> > >>>> The error is coming from LM optimiser. You should reduce number of > points in your vol surface or add more calibration instruments or add some > sort of regularisation. > >>>> > >>>> Kind regards, > >>>> Dmitri. > >>>> > >>>> On Mon, 22 Aug 2022, 17:26 Daniel, <gr...@gm...> wrote: > >>>>> > >>>>> All, > >>>>> > >>>>> Please forgive me if someone has answered a similar question before. > >>>>> > >>>>> I am trying to calibrate interest rate vol surface using GSR > (gaussian short rate model) based on this post > >>>>> > http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html > >>>>> > >>>>> and I found a python example for GSR model calibration. > >>>>> https://github.com/mlungwitz/notebooks/blob/master/GSR_Example.ipynb > >>>>> > >>>>> What I tried to do is to calibrate the same european swaption vol > surface in the 1st python example based on 2nd example gsr model > specification, what I added is: > >>>>> gsr = ql.Gsr(term_structure,stepDates, sigmas,reversions); > >>>>> engine = ql.Gaussian1dSwaptionEngine(gsr, 64, 7.0, True, False, > term_structure) > >>>>> swaptions = create_swaption_helpers(data, index, term_structure, > engine) > >>>>> > >>>>> optimization_method = ql.LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8) > >>>>> end_criteria = ql.EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8) > >>>>> model.calibrate(swaptions, optimization_method, end_criteria) > >>>>> > >>>>> But this will give me this error: > >>>>> > >>>>> RuntimeError: less functions (5) than available variables (12) > >>>>> > >>>>> Is the error caused by Gaussian1dSwaptionEngine? Should I proceed > with Gaussian1dNonstandardSwaptionEngine? What change should I do to make > it work ? > >>>>> > >>>>> > >>>>> Thanks, > >>>>> > >>>>> Mark > >>>>> > >>>>> _______________________________________________ > >>>>> QuantLib-users mailing list > >>>>> Qua...@li... > >>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > >>> > >>> _______________________________________________ > >>> QuantLib-users mailing list > >>> Qua...@li... > >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users > |
|
From: Tlhogi D <dgr...@gm...> - 2022-08-24 20:29:17
|
Hi, I have received a response to this issue and resolved it: The package name is QuantLib with a capital L, not Quantlib. Thanks! On Wed, 24 Aug 2022 at 21:59, Tlhogi D <dgr...@gm...> wrote: > Hi, > > I have installed Anaconda3 and launched JupyterNotebook via the Navigator. > Within that, I am trying to import Quantlib, but am getting an error > message: > ModuleNotFoundError: No module named 'Quantlib' > > I have verified that Quantlib has been installed; please see the > screenshot with the system path and error message below. > [image: image.png] > > Could you please suggest how I can resolve this issue? > Thanks in advance for your help! > > Regards > Grace > |
|
From: Tlhogi D <dgr...@gm...> - 2022-08-24 19:59:39
|
Hi, I have installed Anaconda3 and launched JupyterNotebook via the Navigator. Within that, I am trying to import Quantlib, but am getting an error message: ModuleNotFoundError: No module named 'Quantlib' I have verified that Quantlib has been installed; please see the screenshot with the system path and error message below. [image: image.png] Could you please suggest how I can resolve this issue? Thanks in advance for your help! Regards Grace |
|
From: Peter C. <pca...@gm...> - 2022-08-24 13:37:03
|
Hi Daniel yes you'd change T in the ctor call ql.Gsr(...). 1. T is the maturity of the zero bond P(0, T) used as a numeraire in the T-Forward measure 2. years 3. slightly higher than 60 I'd think to capture day counter / convention / lag effects, maybe 61 is sufficient already Thanks Peter On Wed, 24 Aug 2022 at 11:47, Daniel <gr...@gm...> wrote: > > Peter, > Thank you for your reply. > Just want to make sure overwriting T means I should change below statement > model = ql.Gsr(term_structure,stepDates, sigmas,reversions,T=60); > to use some other T value instead, am I right? > Two questions: > 1. What is the meaning of T here? > 2. What is the unit for T (month, year)? > 3. If my calibrated swaption has a maximum 30Y x 30Y matrix, what is the T value I should use? > > Thanks, > Mark > > > On Tue, Aug 23, 2022 at 1:30 PM Peter Caspers <pca...@gm...> wrote: >> >> Hi >> >> the GSR model operates in the T-forward measure with T=60 by default. You can overwrite T in the constructor if longer horizons are needed (as it appears to be the case in your setup). >> >> Best >> Peter >> >> >> Daniel <gr...@gm...> schrieb am Mo. 22. Aug. 2022 um 21:25: >>> >>> Thank you Dmitri for your information. Actually I increased the vol surface number to more than to be calibration volatility number, now I can solve for mean reversion and volatility now. >>> >>> But experience another error when I tried to change the yield curve and volatility surface to some other type, I got below error. >>> >>> ---> 14 model.calibrate(swaptions, optimization_method, end_criteria) >>> >>> ~\.conda\envs\tf-gpu\lib\site-packages\QuantLib\QuantLib.py in calibrate(self, *args) >>> >>> def calibrate(self, *args): >>> > return _QuantLib.Gsr_calibrate(self, *args) >>> >>> def setParams(self, params): >>> >>> RuntimeError: G(t,w) should be called with (t,w)=(29.9985,60.0055) in Range [0,60]. >>> >>> >>> What does this runtimeError mean? >>> >>> >>> Thanks, >>> >>> Mark >>> >>> >>> >>> >>> >>> >>> On Mon, Aug 22, 2022 at 12:50 PM Dmitri Goloubentsev <dm...@ma...> wrote: >>>> >>>> Hi Mark, >>>> >>>> >>>> The error is coming from LM optimiser. You should reduce number of points in your vol surface or add more calibration instruments or add some sort of regularisation. >>>> >>>> Kind regards, >>>> Dmitri. >>>> >>>> On Mon, 22 Aug 2022, 17:26 Daniel, <gr...@gm...> wrote: >>>>> >>>>> All, >>>>> >>>>> Please forgive me if someone has answered a similar question before. >>>>> >>>>> I am trying to calibrate interest rate vol surface using GSR (gaussian short rate model) based on this post >>>>> http://gouthamanbalaraman.com/blog/short-interest-rate-model-calibration-quantlib.html >>>>> >>>>> and I found a python example for GSR model calibration. >>>>> https://github.com/mlungwitz/notebooks/blob/master/GSR_Example.ipynb >>>>> >>>>> What I tried to do is to calibrate the same european swaption vol surface in the 1st python example based on 2nd example gsr model specification, what I added is: >>>>> gsr = ql.Gsr(term_structure,stepDates, sigmas,reversions); >>>>> engine = ql.Gaussian1dSwaptionEngine(gsr, 64, 7.0, True, False, term_structure) >>>>> swaptions = create_swaption_helpers(data, index, term_structure, engine) >>>>> >>>>> optimization_method = ql.LevenbergMarquardt(1.0e-8,1.0e-8,1.0e-8) >>>>> end_criteria = ql.EndCriteria(1000, 100, 1e-6, 1e-8, 1e-8) >>>>> model.calibrate(swaptions, optimization_method, end_criteria) >>>>> >>>>> But this will give me this error: >>>>> >>>>> RuntimeError: less functions (5) than available variables (12) >>>>> >>>>> Is the error caused by Gaussian1dSwaptionEngine? Should I proceed with Gaussian1dNonstandardSwaptionEngine? What change should I do to make it work ? >>>>> >>>>> >>>>> Thanks, >>>>> >>>>> Mark >>>>> >>>>> _______________________________________________ >>>>> QuantLib-users mailing list >>>>> Qua...@li... >>>>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>> >>> _______________________________________________ >>> QuantLib-users mailing list >>> Qua...@li... >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users |