Statistical learning for sectoral equity allocation

Jupyter Notebook of factor calculation Jupyter Notebook of statistical learning

There is sound reason and evidence for the predictive power of macro indicators for relative sectoral equity returns. However, the relations between economic information and equity sector performance can be complex. Considering the broad range of available point-in-time macro-categories that are now available, statistical learning has become a compelling method for discovering macro predictors and supporting prudent and realistic backtests of related strategies. This post shows a simple five-step method to use statistical learning to select and combine macro predictors from a broad set of categories for the 11 major equity sectors in 12 developed countries. The learning process produces signals based on changing models and factors per the statistical evidence. These signals have been positive predictors for relative returns of all sectors versus a broad basket. Combined into a single strategy, these signals create material and uncorrelated investor value through sectoral allocation alone.

(more…)

How “beta learning” improves macro trading strategies

Jupyter Notebook

Macro beta is the sensitivity of a financial contract’s return to a broad economic or market factor. Macro betas broaden the traditional concept of equity market betas and can often be estimated using financial contract baskets. Macro sensitivities are endemic in trading strategies, diluting alpha, undermining portfolio diversification, and distorting backtests. However, it is possible to immunize strategies through “beta learning,” a statistical learning method that supports identifying appropriate models and hyperparameters and allows backtesting of hedged strategies without look-ahead bias. The process can be easily implemented with existing Python classes and methods. This post illustrates the powerful beneficial impact of macro beta estimation and its application on an emerging market FX carry strategy.

(more…)

FX trading signals with regression-based learning

Jupyter Notebook

Regression-based statistical learning helps build trading signals from multiple candidate constituents. The method optimizes models and hyperparameters sequentially and produces point-in-time signals for backtesting and live trading. This post applies regression-based learning to macro trading factors for developed market FX trading, using a novel cross-validation method for expanding panel data. Sequentially optimized models consider nine theoretically valid macro trend indicators to predict FX forward returns. The learning process has delivered significant predictors of returns and consistent positive PnL generation for over 20 years. The most important macro-FX signals, in the long run, have been relative labor market trends, manufacturing business sentiment changes, relative inflation expectations, and terms of trade dynamics.

(more…)

Macroeconomic data and systematic trading strategies

While economic information undeniably wields a significant and widespread influence on financial markets, the systematic incorporation of macroeconomic data into trading strategies has thus far been limited. This reflects skepticism towards economic theory and serious data problems, such as revisions, distortions, calendar effects, and, generally, the lack of point-in-time formats. However, the emergence of industry-wide quantamental indicators and the rise of statistical learning methods in financial markets make macroeconomic information more practical and powerful. Successful demonstrations of statistical learning and macro-quantamental indicators have been achieved, with various machine learning techniques poised to further improve the utilization of economic information.

(more…)

Regression-based macro trading signals

Jupyter Notebook

Regression is one method for combining macro indicators into a single trading signal. Specifically, statistical learning based on regression can optimize model parameters and hyperparameters sequentially and produce signals based on whatever model has predicted returns best up to a point in time. This method learns from growing datasets and produces valid point-in-time signals for backtesting. However, whether regression delivers good signals depends on managing the bias-variance trade-off of machine learning. This post provides guidance on pre-selecting the right regression models and hyperparameter grids based on theory and empirical evidence. It considers the advantages and disadvantages of various regression methods, including non-negative least squares, elastic net, weighted least squares, least absolute deviations, and nearest neighbors.

(more…)

Optimizing macro trading signals – A practical introduction

Jupyter Notebook

Based on theory and empirical evidence, point-in-time indicators of macroeconomic trends and states are strong candidates for trading signals. A key challenge is to select and condense them into a single signal. The simplest (and often successful) approach is conceptual risk parity, i.e., an equally weighted average of normalized scores. However, there is scope for optimization. Statistical learning offers methods for sequentially choosing the best model class and other hyperparameters for signal generation, thus supporting realistic backtests and automated operation of strategies.
This post and an attached Jupyter Notebook show implementations of sequential signal optimization with the scikit-learn package and some specialized extensions. In particular, the post applies statistical learning to sequential optimization of three important tasks: feature selection, return prediction, and market regime classification.

(more…)

How to measure the quality of a trading signal

The quality of a trading signal depends on its ability to predict future target returns and to generate material economic value when applied to positioning. Statistical metrics of these two properties are related but not identical. Empirical evidence must support both. Moreover, there are alternative criteria for predictive power and economic trading value, which are summarized in this post. The right choice depends on the characteristics of the trading signal and the objective of the strategy. Each strategy calls for a bespoke appropriate criterion function. This is particularly important for statistical learning that seeks to optimize hyperparameters of trading models and derive meaningful backtests.

(more…)

Nowcasting macro trends with machine learning

Nowcasting economic trends can make use of a broad range of machine learning methods. This not only serves the purpose of optimization but also allows replication of past information states of the market and supports realistic backtesting. A practical framework for modern nowcasting is the three-step approach of (1) variable pre-selection, (2) orthogonalized factor formation, and (3) regression-based prediction. Various methods can be applied at each step, in accordance with the nature of the task. For example, pre-selection can be based on sure independence screening, t-stat-based selection, least-angle regression, or Bayesian moving averaging. Predictive models include many non-linear models, such as Markov switching models, quantile regression, random forests, gradient boosting, macroeconomic random forests, and linear gradient boosting. There is some evidence that linear regression-based methods outperform random forests in the field of macroeconomics.

(more…)

Finding (latent) trading factors

Financial markets are looking at a growing and broadening range of correlated time series for the operation of trading strategies. This increases the importance of latent factor models, i.e., methods that condense high-dimensional datasets into a low-dimensional group of factors that retain most of their underlying relevant information. There are two principal approaches to finding such factors. The first uses domain knowledge to pick factor proxies up front. The second treats all factors as latent and applies statistical methods, such as principal components, to a comprehensive set of correlated variables. A new paper proposes to combine domain knowledge and statistical methods using penalized reduced-rank regression. The approach promises improved accuracy and robustness.

(more…)

Testing macro trading factors

The recorded history of modern financial markets and macroeconomic developments is limited. Hence, statistical analysis of macro trading factors often relies on panels, sets of time series across different currency areas. However, country experiences are not independent and subject to common factors. Simply stacking data can lead to “pseudo-replication” and overestimated significance of correlation. A better method is to check significance through panel regression models with period-specific random effects. This technique adjusts targets and features of the predictive regression for common (global) influences. The stronger these global effects, the greater the weight of deviations from the period-mean in the regression. In the presence of dominant global effects, the test for the significance of a macro factor would rely mainly upon its ability to explain cross-sectional target differences. Conveniently, the method automatically accounts for the similarity of experiences across markets when assessing the significance and, hence, can be applied to a wide variety of target returns and features. Examples show that the random effects method can deliver a quite different and more plausible assessment of macro factor significance than simplistic statistics based on pooled data.

(more…)