Pitfalls of Nelson-Siegel Yield Curve Modeling – Part II – what ML and AI can[not] do

In our previous post on Nelson-Siegel model we have shown some pitfalls of it. In this follow-up we will discuss how to circumvent them and how machine learning and artificial intelligence can[not] help. Continue reading "Pitfalls of Nelson-Siegel Yield Curve Modeling – Part II – what ML and AI can[not] do"

Pitfalls of Nelson-Siegel Yield Curve Modeling – Part I

The Nelson-Siegel-[Svensson] Model is a common approach to fit a yield curve. Its popularity might be explained with economic interpretability of its parameters but most likely it is because the European Central Bank uses it. However, what may do for ECB will not necessarily work in all cases: the model parameters are sometimes extremely unstable and fail to converge.Nelson-Siegel Calibration Failure in YieldCurve R Package Continue reading "Pitfalls of Nelson-Siegel Yield Curve Modeling – Part I"

Building Open Source Risk Engine (Quaternion ORE) in VS2017 without Git

The Open Source Risk Engine is an opensource software project for risk analytics and xVA. It is written (mostly) in C++ and based on QuantLib. In this post we explain how the ORE can be built from source in Visual Studio 2017. Continue reading "Building Open Source Risk Engine (Quaternion ORE) in VS2017 without Git"

QuantLib Python – debugging C++ side with Visual Studio and PyCharm – a dirty way

QuantLib Python - a port of C++ library to Python via SWIG - provides a lot of advantages for a practical usage. In particular, it gives a great flexibility due to interactive python console and allows a seamless integration with the AI libraries like Keras and Tensorflow. However, it seems to be challenging to debug the C++ code, called from Python side. So far we found out a quick but dirty solution. Continue reading "QuantLib Python – debugging C++ side with Visual Studio and PyCharm – a dirty way"

Visualizing the Fundamental Data on 400 Stocks over 80 Quarters

It is relatively easy to visualize the aggregated statistics over many periods, e.g. by means of the boxplot series. However, it may be challenging if you want to have a simultaneous look at every element for all time periods. We propose to do it by means of an animated 3D-scatterplot. Continue reading "Visualizing the Fundamental Data on 400 Stocks over 80 Quarters"

Classifying Time Series with Keras in R : A Step-by-Step Example

We test different kinds of neural network (vanilla feedforward, convolutional-1D and LSTM) to distinguish samples, which are generated from two different time series models. Contrary to a (naive) expectation, conv1D does much better job than the LSTM. Continue reading "Classifying Time Series with Keras in R : A Step-by-Step Example"

R code to detect support and resistance levels

Support and resistance levels are quite popular among traders. Although they are implemented in many apps and services, an open source implementation of the algorithm is hardly available. We try to close the gap.
Continue reading "R code to detect support and resistance levels"

QuantLib Python – Twisting a Snake to fit a Yieldcurve

I explain how to install QuantLib Python from sources and discuss how to fit a yield curve: PiecewiseLogCubicDiscount and NelsonSiegel.
Continue reading "QuantLib Python – Twisting a Snake to fit a Yieldcurve"

Visualizing the Data on 6356 American Stocks – with R source code

By current artificial intelligence, big data and robo-advisory hype many people believe that computers can do everything for you. I am pretty skeptical about it. Never denying (and actively engaging by myself) a computer-aided trading and investment I always claim "man and machine" rather than "man vs. machine". In this post I show you how to summarize and visualize the data from Alpha Vantage for 6356 American stocks. Continue reading "Visualizing the Data on 6356 American Stocks – with R source code"

Calculate CAGR of Your Savings Plan | Free Online Calculator


This tool allows you to calculate the compound annual growth rate (CAGR) of your 401(k) savings plan. All you need is to know the size and dates of your installments and the market value of your savings plan on the reference date. Irregular (aperiodic) installment are supported but the (partial) withdrawals are not since it is, in general, impossible to uniquely define the CAGR for a cashflow with several pay-offs Continue reading "Calculate CAGR of Your Savings Plan | Free Online Calculator"