SERVING THE QUANTITATIVE FINANCE COMMUNITY

finanzmaster
Topic Author
Posts: 112
Joined: March 11th, 2007, 1:04 pm

### Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

Python
https://letyourmoneygrow.com/2018/04/14 ... ieldcurve/

Excel
https://letyourmoneygrow.com/2018/02/10 ... eld-curve/

I, myself, prefer Python.
The only problem: I have not, so far, found a way to attach Python [IDE] process to Visual Studio in order to debug QuantLib when it is called from Python
Any ideas?

Cuchulainn
Posts: 62394
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

Not sure what you mean by "attach" but Python can be installed on VS

https://docs.microsoft.com/en-us/visual ... ual-studio

?

mtsm
Posts: 352
Joined: July 28th, 2010, 1:40 pm

### Re: Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

Python
https://letyourmoneygrow.com/2018/04/14 ... ieldcurve/

Excel
https://letyourmoneygrow.com/2018/02/10 ... eld-curve/

I, myself, prefer Python.
The only problem: I have not, so far, found a way to attach Python [IDE] process to Visual Studio in order to debug QuantLib when it is called from Python
Any ideas?
Yeah, I have done that successfully with pycharm and VS 2017. You just need to run your code from within the pycharm ide in debug mode, then pick up the python process id and attach that to VS and bingo. You can seemlessly navigate between the two ides.
It's true that you can get python into VS. PTVS is pretty cool really. I have used it for a while, but then pycharm is just so nice, can't live without it. Also it's properly cross platform. The issue with MS tools is that it's not that great on unix, although it's come along way.
What worries me a bit more is that you are using QL which is a piece of dung to be honest. There is too much amateurism in that framework, it's a real issue. You cannot have a quant finance library of quality if you do not get front office quants from top international IBs involved. It's just not possible. It's an unwritten and unspoken rule, but I am seeing it confirmed over and over again. The reason is that top IBs de facto set the rules.

finanzmaster
Topic Author
Posts: 112
Joined: March 11th, 2007, 1:04 pm

### Re: Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

Many thanks, @mtsm, I will try the way to debug, which you have described.

As to the quality of QL, well, of course QL (as any other software) has shortcomings.
But it is open-source, the code can be tuned (either quick&dirty or fine - depending on your time and manpower). And there is an involved community (I myself regularly take part in QL User Meeting in Düsseldorf), so one can hire an expert to do the (fine) tuning of QuantLib.
Last but not least I like QL alone due to its date arithmetic.

Cuchulainn
Posts: 62394
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

### Re: Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

Sounds a bit harsh. Don't you use Nelson Siegel in QL as well?(?)
??
ql.PiecewiseLogCubicDiscount(today, bondHelpers, curveDaycounter)
A nicer way than QuantlixL is to use Excel-DNA in C# and C++/CLI combination (by wrapping legacy C++ code in .NET wrapper). In that sense XL is real legacy code.

finanzmaster
Topic Author
Posts: 112
Joined: March 11th, 2007, 1:04 pm

### Re: Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

Sounds a bit harsh. Don't you use Nelson Siegel in QL as well?(?)
I do.
However, one has to tune it because by default the QuantLib tries to fit all 4 model parameters simultaneously.
This is, however, rather a problem of NS than of QuantLib.
A practical solution is to fix the kappa and then fit other 3 parameters. A smarter way may be not to consider just today bond prices but take into account their time series and fit the yield curve with a kind of temporal consistency. For this one has to tune QL but as I said, tuning is normal and often better than starting from scratch.

finanzmaster
Topic Author
Posts: 112
Joined: March 11th, 2007, 1:04 pm

### Re: Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

@mtsm
Debugging of the C++ part seems to be not so seamless.
Finally, I found out a work around but I myself hold it for dirty.
https://letyourmoneygrow.com/2018/06/10 ... dirty-way/

tagoma
Posts: 18362
Joined: February 21st, 2010, 12:58 pm

### Re: Fitting a YieldCurve in QuantLib: QuantLibXL vs. QuantLib-Python

What worries me a bit more is that you are using QL which is a piece of dung to be honest. There is too much amateurism in that framework, it's a real issue. You cannot have a quant finance library of quality if you do not get front office quants from top international IBs involved. It's just not possible. It's an unwritten and unspoken rule, but I am seeing it confirmed over and over again. The reason is that top IBs de facto set the rules.
Simple outside observer, here - What exactly does QL do so bad as compared to frameworks you know at major IBs, please?