This method estimates portfolio weights for a spread using the Box–Tiao canonical decomposition. It first reorders the price columns so the selected dependent asset comes first, demeans the data, and fits a first-order vector autoregression. It combines the…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
40 documents
This code module outlines methods for constructing sparse portfolios intended to exhibit mean reversion. It includes Box–Tiao canonical decomposition, greedy support selection, semidefinite optimization under volatility constraints, and sparsity methods…
The document describes a software implementation of the Johansen cointegration method for forming mean-reverting portfolios from asset prices. It computes cointegration vectors, orders them by eigenvalue, and converts each vector into hedge ratios normalized…
The module implements the two-step Engle–Granger approach to constructing a portfolio intended to be mean reverting. It uses ordinary least squares to regress a chosen dependent asset’s price on the other price series, defaulting to the first input column as…
This introduction explains how cointegration can help create a mean-reverting portfolio from price series that are not themselves mean-reverting. By combining multiple assets with suitable weights, a trader may construct a spread or portfolio whose value…
This implementation describes convergence trading for two cointegrated assets as a portfolio optimization problem. It estimates error-correction speeds and other model parameters from price data, then computes portfolio weights under both unconstrained and…
This guide explains how unit-root and cointegration tests can help identify mean-reverting combinations of asset prices. It presents the Augmented Dickey–Fuller test as a test of whether price changes depend on the current level, and relates the estimated…
This tutorial illustrates how combining assets or strategies can smooth portfolio returns and raise the portfolio Sharpe ratio, even when individual components have weak risk-adjusted performance. It generates synthetic return series, builds equal-weight…
This reference explains how information theory can measure dependence between variables, including asset returns. It introduces entropy as uncertainty, then defines mutual information as the reduction in uncertainty about one variable from observing another.…
The introduction frames pairs trading as a way to create a mean-reverting portfolio by holding one risky asset and shorting another correlated or co-moving asset. Such a spread may offer statistical arbitrage opportunities, but the central challenge is…
This document describes a class for applying an exponential Ornstein–Uhlenbeck model to mean-reverting portfolio prices. It inherits fitting and portfolio construction from an OU model, then works in log-price space to estimate optimal liquidation levels,…
The document explains how to form and evaluate long-short stock portfolios, focusing on pairs trading. It compares hedge-ratio methods: ordinary least squares minimizes portfolio variance under a correlated random-walk and Gaussian framework, while total…
This implementation describes a pairs-trading method based on modeling the log price relationship between two stocks as an Ornstein–Uhlenbeck process. It constructs the spread as the difference between the stocks’ log prices, fills missing observations…
This code utility builds pairwise dependence matrices from columns in a feature DataFrame. It supports information-based measures, distance correlation, rank correlation, GPR and GNPR distances, and optimal-transport dependence. Parameters let users…
This module describes a trading rule built around a pre-estimated multivariate cointegration vector. It calculates the weighted sum of log prices, differences that series across recent observations, and uses the sign of the summed changes to set trade…
This method uses principal component analysis to separate broad equity return drivers from stock-specific residuals, then trades residual portfolios expected to revert toward equilibrium. Returns are standardized before estimating their correlation matrix;…
The Pearson approach forms equity pairs by ranking stocks on the correlation of their monthly returns during a formation period. For each stock, it selects the most highly correlated peers and combines their returns into a benchmark portfolio, using either…
This implementation describes a bivariate Student-t copula for modeling dependence between two variables represented by uniform pseudo-observations. It explains sampling from a correlated Student-t distribution, evaluating copula density and cumulative…
This document explains copula-based measures for comparing financial return series by separating marginal distributions from dependence. It presents Spearman’s rho as a rank-based dependence measure and contrasts it with Pearson correlation, which captures…
This document extends a cointegration-based spread strategy from pairs to three or more assets. It forms a weighted combination of log prices using a cointegration vector, then derives a spread return from the same weights. Under stated stationarity…
This implementation describes an equity pairs strategy that selects stocks with highly correlated historical returns, then compares each stock’s return with a portfolio of its selected peers. It estimates a regression coefficient during a formation period…
The document presents a literature-search workflow for financial machine learning and quantitative finance, where relevant work may be spread across econometrics, machine learning, and other fields. It describes using a paper-mapping service to find related…
Hedge ratios set the relative sizes of legs in a spread so that price differences do not leave the position unintentionally unbalanced in dollar terms. The document introduces a simple price-ratio method, then describes normalizing weights so the dependent…
This code reference presents several ways to measure dependence or distance between financial data vectors and matrices. It defines angular distance from Pearson correlation, plus absolute and squared variants that alter how negative or strong correlations…