Quant Mashup - Quant Dare
Automating cryptocurrencies investment [Quant Dare]
Who has never heard about cryptocurrencies: Bitcoin, Ethereum, Cardano, or even the latest ones, such as Shiba or Safemoon? The investors are rapidly increasing their positions in those assets, although investing in them is usually a pain in the neck. These assets have a high volatility and their
- 2 years ago, 16 Jun 2021, 09:45am -
Concepts of Entropy in Finance: Transfer entropy [Quant Dare]
The concept of entropy has many useful applications in finance such as measuring risk, uncertainty, or noise in a signal. In this post we will focus on transfer entropy, a useful tool for causal inference between financial time series. What is entropy? Entropy in general represents the uncertainty,
- 2 years ago, 10 Jun 2021, 09:57am -
Linking Attribution Factors [Quant Dare]
In the business of performance measurement, a recurrent task is the breakdown of a stream of returns into meaningful contributions from different factors, in order to identify the driving financial forces or sources of risk. Eventually, these daily contributions have to be aggregated to explain the
- 2 years ago, 2 Jun 2021, 03:15am -
Different methods for mitigating overfitting on Neural Networks [Quant Dare]
Using Machine Learning and Deep Learning models to solve scientific problems of greater or lesser complexity is a challenge. Referring to neural networks, on the one hand, simple networks with too little capacity will not learn the problem well producing a model that underfits the data. On the other
- 2 years ago, 27 May 2021, 11:28am -
Reducing data dimensionality using PCA [Quant Dare]
One common problem when looking at financial data is the enormous number of dimensions we have to deal with. For instance, if we are looking at data from the S&P 500® index, we will have around 500 dimensions to work with! If we have enough computing power, we will be able to process so much
- 2 years ago, 28 Apr 2021, 11:30pm -
What cannot be hedged [Quant Dare]
When looking to generate appreciable returns and increase diversification, it is natural to consider investing in foreign instruments. Currency risk then comes up, since the returns coming from these funds, stocks, bonds… need to be translated into your home currency. The most straightforward
- 3 years ago, 14 Apr 2021, 12:16pm -
What is Mutual Information? [Quant Dare]
In the field of machine learning, when it comes to extracting relationships between variables, we often use Pearson correlation. The problem is that this measure only finds linear relationships, which can lead sometimes to a bad interpretation of the relation between two variables. Nevertheless,
- 3 years ago, 1 Apr 2021, 11:50am -
In Search of Lost Covered Interest Parity [Quant Dare]
The puzzle of Covered Interest Parity (CIP) began in 2008 and has remained as such for many years. There have been multiple attempts to solve the mystery but none of them has reached a complete consensus and the debate is still ongoing. Nevertheless, the discussion has lead to a fair amount of
- 3 years ago, 24 Mar 2021, 11:10am -
4 simple ways to label financial data for Machine Learning [Quant Dare]
We have seen in previous posts what is machine learning and even how to create our own framework. Combining machine learning and finance always leads to interesting results. Nevertheless, in supervised learning, it is crucial to find a set of appropriate labels to train your model. In today’s
- 3 years ago, 17 Mar 2021, 11:01am -
SigCWGAN, a new generation GAN architecture for Time Series Generation [Quant Dare]
As a continuation to our last post on Time Series Signatures and our running list of posts regarding GANs and synthetic data we now want to present the Signature Conditional Wasserstein GAN, shortened as SigCWGAN, a new GAN architecture presented in [1] that is specifically designed to generate time
- 3 years ago, 24 Feb 2021, 10:09am -
Second chances with momentum [Quant Dare]
A couple of days ago we were seeing in the news the story about GameStop, and how small investors made some hedge funds abandon their short-selling positions after some big losses. After reading the article I couldn’t resist thinking about short-selling strategies and their performance in the
- 3 years ago, 10 Feb 2021, 10:04am -
Improving time series animations in matplotlib (from 2D to 3D) [Quant Dare]
Animating time series is a very powerful tool to show evolution over time, but matplotlib default animations are boring and they are not well suited for comparison purposes. Along this blog, animations are widely used: from explaining how neural networks train, to showing synthetic time-series
- 3 years ago, 5 Feb 2021, 10:13am -
Reinforcement Learning for Trading [Quant Dare]
One of the most appealing areas of Artificial Intelligence is Reinforcement Learning, for its applicability to a variety of areas. It can be applied to different kinds of problems, in the present article we will analyze an interesting one: Reinforcement Learning for trading strategies. Reinforcement
- 3 years ago, 18 Dec 2020, 11:14am -
Decision Trees: Gini vs Entropy [Quant Dare]
Decision Trees are one of the best known supervised classification methods. As explained in previous posts, “A decision tree is a way of representing knowledge obtained in the inductive learning process. The space is split using a set of conditions, and the resulting structure is the tree“ A
- 3 years ago, 2 Dec 2020, 09:44am -
Does low volatility anomaly work in funds? [Quant Dare]
After many years there are many evidences that the low volatility anomaly works in stock markets. We have also mentioned this topic a long time ago to analysis the costs of it. This anomaly says stocks with less price variability deliver higher returns, contrary to everyone’s belief, which expects
- 3 years ago, 19 Nov 2020, 10:18am -
Deflated Sharpe Ratio (how to avoid been fooled by randomness) [Quant Dare]
As we test more and more strategies the overall probability of choosing at least one poor strategy grows. So we must be very careful with how many backtests we run. We should always record all of them, to later deflate the Sharpe Ratio accordingly. In this post, we are going to analyze how the
- 3 years ago, 5 Nov 2020, 09:54pm -
Dream team: Combining classifiers [Quant Dare]
When you are in front of a complex classification problem, often the case with financial markets, different approaches may appear while searching for a solution. These systems can estimate the classification and sometimes none of them is better than the rest. In this case, a reasonable choice is to
- 3 years ago, 29 Oct 2020, 10:57am -
Clustering S&P500 using Fully Convolutional Autoencoders [Quant Dare]
Clustering data into groups that share common characteristics can be very useful, but using experts to perform this grouping is costly and in many cases decisions are influenced by emotions. That is why clustering is one of the main topics of Unsupervised Machine Learning algorithms, that doesn’t
- 3 years ago, 14 Oct 2020, 09:09am -
FX Swap pricing and the mystery of Covered Interest Parity [Quant Dare]
Sometimes described as a sort of physical law in international finance [1], Covered Interest Parity (CIP) has failed to hold after the Global Financial Crisis (GFC) of 2008. This has given rise to an interesting debate during the last decade that has resulted in relevant insights regarding
- 3 years ago, 7 Oct 2020, 11:23am -
An Introduction to Time Series Signatures [Quant Dare]
The Signature of a time series is a universal description for a stream of data derived from the theory of controlled differential equations. Over the last years, this technique has been used successfully applied in a wide array of Machine Learning tasks dealing with sequential data, such as the
- 3 years ago, 24 Sep 2020, 08:49pm -
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
- 3 years 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
- 3 years 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
- 3 years 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
- 3 years 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 years 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 years 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 years 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
- 3 years 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
- 3 years 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
- 3 years 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
- 4 years 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,
- 4 years 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
- 4 years 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
- 4 years 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,
- 4 years 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,
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years ago, 23 Oct 2019, 11:45am -
Mitigating overfitting 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!
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years 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
- 4 years ago, 3 Jul 2019, 09:06am -