SERVING THE QUANTITATIVE FINANCE COMMUNITY

 
User avatar
finanzmaster
Topic Author
Posts: 102
Joined: March 11th, 2007, 1:04 pm

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

April 14th, 2018, 8:51 am

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?
 
User avatar
Cuchulainn
Posts: 55629
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

April 14th, 2018, 7:09 pm

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

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

?
 
User avatar
mtsm
Posts: 337
Joined: July 28th, 2010, 1:40 pm

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

April 14th, 2018, 9:14 pm

finanzmaster wrote:
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.
 
User avatar
finanzmaster
Topic Author
Posts: 102
Joined: March 11th, 2007, 1:04 pm

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

April 15th, 2018, 7:19 am

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. :)
 
User avatar
Cuchulainn
Posts: 55629
Joined: July 16th, 2004, 7:38 am
Location: Amsterdam
Contact:

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

April 15th, 2018, 9:21 am

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.
 
User avatar
finanzmaster
Topic Author
Posts: 102
Joined: March 11th, 2007, 1:04 pm

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

April 15th, 2018, 11:07 am

Cuchulainn wrote:
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.
 
User avatar
finanzmaster
Topic Author
Posts: 102
Joined: March 11th, 2007, 1:04 pm

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

June 10th, 2018, 1:56 pm

@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/
 
User avatar
tagoma
Posts: 17908
Joined: February 21st, 2010, 12:58 pm

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

June 13th, 2018, 8:08 pm

mtsm wrote:
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?
ABOUT WILMOTT

PW by JB

Wilmott.com has been "Serving the Quantitative Finance Community" since 2001. Continued...


JOBS BOARD

JOBS BOARD

Looking for a quant job, risk, algo trading,...? Browse jobs here...