Quant Mashup - Quant Dare

Kelly criterion: Part 2 [Quant Dare]

When investing, we spend plenty of time thinking about which securities should we buy but we rarely wonder how much money should we allocate in each asset. Although it does not seem like an important aspect, it is crucial when defining a strategy, up to the point that it can determine the hole

*- 1 week ago, 10 Sep 2020, 10:33am -*

Introduction to NLP: Sentiment analysis and Wordclouds [Quant Dare]

I think one of the most interesting areas in the data analysis field is Natural Language Processing (NLP). These last years this discipline has grown exponentially and now it’s a huge area with a lot of problems we can attempt to solve, like text classification, translations or text generation In

*- 1 month ago, 29 Jul 2020, 09:46am -*

The secret sauce that makes Deep Learning frameworks so powerful [Quant Dare]

Inside most of the Deep Learning frameworks that are available lies a powerful technique called Automatic Differentiation. If you ever encountered these words but don’t know what they mean or how this procedure works, this post is for you. In a previous post, we saw how to built a deep learning

*- 1 month ago, 22 Jul 2020, 11:06am -*

Finance Factors Coordination? Cascade Selection [Quant Dare]

Currently, strategies based on premium factors are everywhere: from funds or ETFs built on ratios or statistics perfectly specified, trying to exploit specific factor premia, to boutique instruments more or less opaque that following one or more risk premia. In any case, one of the questions we may

*- 2 months ago, 15 Jul 2020, 10:39am -*

What is the difference between Extra Trees and Random Forest? [Quant Dare]

Extra Trees and Random Forest are two very similar ensemble methods and often a doubt arises as to whether to use one or the other. What is really the difference between them? In previous posts, “Random forest: many are better than one”, we have seen how to create a Random Forest from decision

*- 3 months ago, 17 Jun 2020, 11:29am -*

Variational autoencoder as a method of data augmentation [Quant Dare]

In this blog we’ve talked about autoencoders several times, both as outliers detection and as dimensionality reduction. Now, we present another variation of them, variational autoencoder, which makes possible data augmentation. If you have ever faced Machine Learning problems, you will have dealt

*- 3 months ago, 3 Jun 2020, 11:02am -*

Probabilistic Sharpe Ratio [Quant Dare]

Can a Sharpe ratio of 1.55 be better than a Sharpe ratio of 1.63 in a 1 year track-record? Not necessarily. Sharpe ratios are not comparable, unless we control the skewness and kurtosis of the returns. In this post we are going to analyze the advantages of the Probabilistic Sharpe Ratio exposed by

*- 3 months ago, 20 May 2020, 09:52am -*

Can neural networks predict the stock market just by reading newspapers? [Quant Dare]

Markets are said to be driven by randomness, but this does not imply that they are 100% random and thus, completely unpredictable. In the end, there are always people behind investments and many of them are making decisions based on what they read in newspapers. We will be trying to estimate the

*- 4 months ago, 6 May 2020, 11:32am -*

Understanding Neural Networks (with Graphs) [Quant Dare]

Artificial Neural Networks (ANN) have been applied with success to many daily tasks that needed human supervision, but due to its complexity, it is hard to understand how they work and how they are trained. Along this blog, we have deeply talked about what Neural Networks are, how they work, and how

*- 4 months ago, 30 Apr 2020, 09:34am -*

Hedging an Option through the Black-Scholes model in discrete time [Quant Dare]

The Black-Scholes formula can be used to create a hedge for an option. However, this model is derived in continuous time. What happens when we use it to hedge an option in discrete-time? European options are financial securities which give their holder the right (but not the obligation) to buy or

*- 4 months ago, 22 Apr 2020, 12:20pm -*

A primer on embedded currency risk [Quant Dare]

In a previous post, we showed that unhedged currency exposure adds unrewarded risk to our investment, hurting risk-adjusted-performance. This risk should either be neutralized through passive hedging; or mitigated and turned into profit with an active overlay, the latter being what ETS has been

*- 5 months ago, 15 Apr 2020, 10:39am -*

The other way around: from correlations to returns [Quant Dare]

In one way or another, most quantitative models somehow seek to find and exploit relationships between two or more series of returns. Therefore, the usual pipeline has a time-series go through mathematical procedures which condensate in a couple of figures meaningful information: the expected mean,

*- 5 months ago, 8 Apr 2020, 11:17am -*

Predicting the fall: Revisiting the “Forecasting VIX peaks” experiment [Quant Dare]

We are living through unprecedented times. Due to the ongoing global health pandemic, the international markets have plummeted with speeds never seen before, reminiscent of the 1930s and the Great Depression. On February 19, 2020, the SP500 Index closed at an all-time high price and then proceeded

*- 5 months ago, 1 Apr 2020, 01:46pm -*

Is robustness an ally? [Quant Dare]

Many investment strategies use the mean like an official parameter. However, this estimator can be considered non-robust, being easily affected by outliers. But if we take a look at almost any financial series, we will notice that outliers may appear more often than we might think. Introduction In

*- 6 months ago, 18 Mar 2020, 12:08pm -*

Create your own Deep Learning framework using Numpy [Quant Dare]

I have always been curious about how deep learning frameworks are created. I use Keras, TensorFlow, and PyTorch and they all are really good, but sometimes I feel like I am playing with a black box (in some frameworks I feel it more than in others) that hides its secrets. If you feel the same way,

*- 6 months ago, 26 Feb 2020, 10:53am -*

Factor Exposure: The Turn of The Screw [Quant Dare]

You may have seen in different papers or websites, analysis of how a specific active portfolio is exposed to different financial factors (Value, Growth, Size, Quality, etc). This insight is very interesting in order to know what to expect from a strategy and to explain and understand its behaviour,

*- 6 months ago, 19 Feb 2020, 12:07pm -*

Have you tried to calculate derivatives using TensorFlow 2? [Quant Dare]

We will learn how to implement a simple function using TensorFlow 2 and how to obtain the derivatives from it. We will implement a Black-Scholes model for pricing a call option and then we are going to obtain the greeks. Matthias Groncki wrote a very interesting post about how to obtain the greeks

*- 7 months ago, 13 Feb 2020, 10:00am -*

Visualising ETFs with UMAP [Quant Dare]

In previous posts (Visualising Fixed Income ETFs with T-SNE) we have talked about dimensionality reduction algorithms to visualize financial assets and find recognizable patterns. The conclusions were that it didn’t perform well compared to PCA, which is a more classical approach. Can we do any

*- 7 months ago, 5 Feb 2020, 04:09am -*

Generating OHLC bars with Generative Adversarial Networks [Quant Dare]

Open-High-Low-Close (OHLC) bars are a type of financial data typically used to represent daily movements in the price of a financial instrument. They give us more information about certain characteristics of the series than line charts, such as intraday volatility or daily momentum. Could Generative

*- 7 months ago, 31 Jan 2020, 09:53am -*

Autoencoder based outlier detection in Forex [Quant Dare]

In FOREX, both the EURCHF and USDCHF series have outliers that can be a problem when applying Machine Learning techniques to them. So, in this post, the performance of an autoencoder detecting these anomalies is going to be studied. Analyzing the EURCHF and USDCHF returns, it can be seen that there

*- 8 months ago, 15 Jan 2020, 09:31am -*

Dimensionality reduction method through autoencoders [Quant Dare]

We’ve already talked about dimensionality reduction long and hard in this blog, usually focusing on PCA. Besides, in my latest post I introduced another way to reduce dimensions based on autoencoders. However, in that time I focused on how to use autoencoders as predictor, while now I’d like to

*- 9 months ago, 11 Dec 2019, 03:07am -*

Mitigating overfitting on Trading Strategies [Quant Dare]

According to Wikipedia “in finance, a trading strategy is a fixed plan that is designed to achieve a profitable return by going long or short in markets. The main reasons that a properly researched trading strategy helps are its verifiability, quantifiability, consistency, and objectivity. For

*- 9 months ago, 4 Dec 2019, 11:13am -*

Towards the Risk-Free Curve: Logarithmic vs. Arithmetic Returns [Quant Dare]

As Nassim Taleb states, ideas come and go, stories stay. So today Maximiliano and myself are going to build for you a story which hopefully will carve in your mind the importance of doing things right; or put differently, of using logarithmic returns instead of arithmetic returns when you should. To

*- 10 months ago, 30 Oct 2019, 07:35am -*

Trick or treat. It’s Halloween! [Quant Dare]

Let’s start with an experiment. We divide people into two groups, A and B. Then, we ask group A to guess how old Mahatma Gandhi was when he died, taking into account it was after age 9. And we ask group B the same question but taking into account that it was before age 140. Of course, the extra

*- 10 months ago, 23 Oct 2019, 11:45am -*

Mitigating overﬁtting on Financial Datasets with Generative Adversarial Networks [Quant Dare]

What good is synthetic data for in a financial setting? This is a very valid question, given that data augmentation techniques can be hard to evaluate and the time series they produce are very complex. As we will see in this post however, it turns out that synthetic series can be very useful!

*- 11 months ago, 16 Oct 2019, 05:56am -*

An age prediction solution applied to rank returns [Quant Dare]

Image processing is one of the hot topics in AI research, alongside with reinforcement learning, ethics in AI and many others. A recent solution to perform ordinal regression on age of people has been published, and in this post we apply that technique to financial data. Ranking classification is an

*- 11 months ago, 9 Oct 2019, 08:58am -*

Encoding financial texts into dense representations [Quant Dare]

The market is driven by two emotions: greed and fear. Have you ever heard that quote? It is quite popular in financial circles and there may just be some truth behind it. After all, when people, with short-term investments, think are going to lose a lot of money, many of them sell as fast as they

*- 1 year ago, 11 Sep 2019, 06:58pm -*

Geometrical evaluation of Generative Adversarial Networks [Quant Dare]

Generative Adversarial Networks are a quite powerful tool for generating synthetic samples. Visual inspection has been used as a traditional measure of performance. However, it is quite hard to inspect when a time series looks realistic or not! Which methodology can be used then? In order to measure

*- 1 year ago, 24 Jul 2019, 09:59am -*

An intuition behind currency risk [Quant Dare]

Although we find currency risk particularly interesting, it is not often the case with many investors for whom it is no more than a necessary inconvenience. As such, they tend to neglect it, accepting undesirable non-remunerated risks and missing potential opportunities. To prevent this, in this

*- 1 year ago, 18 Jul 2019, 11:51am -*

Graph Theory in portfolio analysis. Part I [Quant Dare]

Have you ever thought about the bias of your portfolio to specific countries or asset types? Do you know that high concentration in one region implies a riskier path for your portfolio? If you want to know how to improve your portfolio using Graph Theory, first you’ll need to understand the

*- 1 year ago, 3 Jul 2019, 09:06am -*

Generating Financial Series with Generative Adversarial Networks Part 2 [Quant Dare]

This is a follow-up post to a recent post in which we discussed how to generate 1-dimensional financial time series with Generative Adversarial Networks. If you haven’t read that post yet we suggest you to do so, since it introduces the building blocks used in this one. Here we will go over the

*- 1 year ago, 24 Jun 2019, 10:22am -*

A Matter of Scale [Quant Dare]

When dealing with mathematical modeling, choosing the right scale to frame the equations can make the difference between a successful and lasting model, or poor description of reality. In today’s post, we explore two important scaling procedures that arise in finance: the annualisation of returns

*- 1 year ago, 20 Jun 2019, 10:53am -*

Classification of Market Regimes [Quant Dare]

Understanding classification of market regimes is fairly important in finance. It all comes down to correctly predicting the way prices are going to move. But prediction isn’t the only crucial thing; knowing how to describe what has already happened is also of great importance. In this QuantDare

*- 1 year ago, 17 Apr 2019, 10:22am -*

Learning to Rank with TensorFlow [Quant Dare]

Alphabet, the largest Internet-based company, has based its success on sophisticated information retrieval algorithms since its origins. Now, 20 years later, one of its divisions is open-sourcing part of its secret sauce, drawing attention from developers all over the world. Since Google was founded

*- 1 year ago, 10 Apr 2019, 01:48pm -*

Understanding the shape of data (II) [Quant Dare]

Topology could be used to gain insight on the shape of our data, as we explained in our last post. Today, we will put this theory into practice by analyzing the 2008 financial crisis. Persistence diagrams We will start by giving an equivalent representation of the persistence barcode that we saw

*- 1 year ago, 3 Apr 2019, 12:50pm -*

Fundamental Manifoldness [Quant Dare]

One of the hardest and most frequent tasks for anyone in the quantitative finance world is to summarize or visualize in a simple way a vast amount of data to represent a company. In this blog, we have covered different Machine Learning techniques that allow us to summarize information through

*- 1 year ago, 27 Mar 2019, 12:58pm -*

Generating Financial Series with Generative Adversarial Networks [Quant Dare]

The scarcity of historical financial data has been a huge hindrance for the development of algorithmic trading models ever since the first models were devised. In the ever-changing economic reality we live in, countless models are tried and evaluated. Most of these models seek to extract information

*- 1 year ago, 20 Mar 2019, 09:11am -*

Ranking Quality [Quant Dare]

The application of Machine Learning for ranking is widely spread. This application of Machine Learning is a little different from the classical ones of classification and regression. In the case of ranking, the interest is not in the accuracy of an estimated value (regression) or the guess about the

*- 1 year ago, 13 Mar 2019, 09:58am -*

Portfolio weightlifting (II) [Quant Dare]

In a previous post, we took a look at the computation of a portfolio’s exposure to its allocations. Then, to show the effects of active management, we compared the return made by two portfolios. But there is so much more to look inside the financial time series. Since we left a couple of

*- 1 year ago, 8 Feb 2019, 10:32am -*

Factor investing in the currency market [Quant Dare]

Factor investing is a broadly used approach in asset management, specially for the equity market, but, can we apply this idea in order to explain currency returns? The idea at the core of factor investing is that there are different sources of risk in the market and that the exposure of the

*- 1 year ago, 16 Jan 2019, 11:07am -*

Omega ratio, the ultimate risk-reward ratio? [Quant Dare]

If you are working in finance, you have almost surely heard of risk-reward ratios and probably used some of them to evaluate the performance of a stock, ETF, or any other investment strategy. Among the different alternatives, the most popular risk-reward ratio is the so-called Sharpe ratio, first

*- 1 year ago, 9 Jan 2019, 01:23pm -*

More examples in Financial Visualisation [Quant Dare]

In line with the previous post Group Funds with the Sun we continue exploring new ways to visualise and analyse financial data. We will take annual data from the current components of Dow Jones Industrial with data going back to 2000 to play around. Animated Risk – Return scatter Risk-Return

*- 1 year ago, 12 Dec 2018, 09:44pm -*

Deep Reinforcement Trading [Quant Dare]

Deep Reinforcement Learning applications in finance are still largely unknown. Nonetheless, recent developments in other fields have pushed researchers towards exciting new horizons. I believe that there is a huge potential for Reinforcement Learning in finance. As investment guru Ray Dalio, founder

*- 1 year ago, 28 Nov 2018, 09:33pm -*

Estimating the probability of something that never happened [Quant Dare]

Have you ever needed to estimate the probability of a rare event? So rare that you haven’t been able to encounter it in real data? Well, what if I told you that there exists a way to calculate a statistically correct approximation. Oh, and you won’t even need a calculator! Recently I have just

*- 1 year ago, 22 Nov 2018, 06:43pm -*

Volcano escape with Gradient Descent [Quant Dare]

Gradient Descent is one of the most important algorithms in Machine Learning. It is an iterative method to find the minimum of a given function. That is the reason why today we will go through the intuition behind it and cover a practical application. Concepts to keep in mind Let’s start. For any

*- 1 year ago, 7 Nov 2018, 10:47am -*

Synthetic prices… and burgers [Quant Dare]

If all finance developers around the world were asked to choose the main nightmare they have to face on daily basis, I bet most of them would choose ‘overfitting’. Furthermore, imagine you have to develop an algorithm which has only one ‘ingredient’ to be modelled, only one time-series

*- 1 year ago, 1 Nov 2018, 10:05am -*

Creating our own S&P 500 Momentum ETF [Quant Dare]

Smart Beta ETFs are achieving an increasing popularity, seen as the perfect equilibrium between passive investment and active management. But, what’s the difference between them and the traditional ones? Is it possible to create our own ETF with some previous experience and without assuming higher

*- 1 year ago, 25 Oct 2018, 11:45pm -*

Scaling/ normalisation/ standardisation: a pervasive question [Quant Dare]

One of the most asked questions when dealing with several features is how you can summarise or transform them to similar scales. As you probably know, many Machine Learning algorithms demand the input features being in similar scales. But, what if they aren’t? Can we just work with raw data in the

*- 1 year ago, 18 Oct 2018, 03:04pm -*

Erratic correlation: an illustration through Chord diagrams [Quant Dare]

Let’s start with a simple question: what is the first thing to think about when you create a portfolio? I’m sure several ideas spring to mind, but let’s go to the heart of the matter: what is the relationship between the assets in a portfolio? That is one of the greatest managers’ concerns.

*- 1 year ago, 3 Oct 2018, 08:34am -*

Value at Risk or Expected Shortfall [Quant Dare]

Value at Risk and Expected Shortfall are related to the risk taken by a portfolio but… Which one is the best? Let’s learn together the differences between these two measures. Risk measures Coherence is really important when defining a risk measurement. If the measure is not coherent, it will not

*- 1 year ago, 28 Sep 2018, 10:44am -*