This helper prepares spread changes and their lagged values as inputs for a regression model. It can expand the lag features with pairwise products, split a chosen in-sample period into ordered training and test sets, and keep a separate out-of-sample…
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
26 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…
This documentation landing page introduces ArbitrageLab, a Python library covering end-to-end pairs-trading strategies and tools for developing strategies. It organizes its subject matter around multiple approaches, including distance methods, cointegration,…
This code excerpt implements neural-network components for a momentum forecasting model based on a temporal fusion transformer design. It includes feed-forward layers, gated linear units, gated residual networks with skip connections and normalization, and…
This module outlines an out-of-sample forecasting workflow built around Auto-ARIMA. It first applies an Augmented Dickey-Fuller test at a five percent significance level, repeatedly differencing the training series until the test indicates stationarity or a…
This module fits a bivariate mixture of Clayton, Student-t, and Gumbel copulas, motivated by a mixed-copula pairs trading approach. It first maps each input series to empirical cumulative probabilities, then estimates component parameters and mixture weights…
This strategy turns changes in a spread series into long and short entry thresholds. It separates historical spread changes into positive and negative values, then calculates a chosen upper quantile of positive changes and a lower quantile of negative…
This implementation builds a committee of neural network regressors, trains each member on the same training data with validation data and early stopping, then averages their predictions. The model class and parameters, committee size, training epochs, and…
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 data-preparation workflow builds model inputs for a momentum strategy from asset closing prices. It clips prices using bounds based on an exponentially weighted mean and standard deviation, derives daily returns and volatility, and creates a next-period…
This code implements a bivariate Gumbel copula for representing dependence between two uniform variables. It provides methods to generate paired samples from independent uniform inputs, calculate the copula density and cumulative distribution, and evaluate a…
This experiment runner configures repeated, rolling train-and-test evaluations for LSTM and Temporal Fusion Transformer models on a multi-asset Quandl dataset. It offers variants with different input sequence lengths and optional changepoint feature…
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…
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…
This code describes a deep learning approach for turning sequential market features into position signals. Its example model uses an LSTM layer followed by dropout and a time-distributed output constrained through a hyperbolic tangent activation. Training…
This code module implements three neural-network architectures that could be applied to quantitative prediction tasks: a feed-forward multilayer perceptron, an LSTM-based recurrent network for sequential inputs, and a Pi-Sigma network that multiplies…
The introduction presents a machine-learning framework for selecting securities for pairs trading. It frames pair discovery as a search-space problem: limiting candidates to securities in the same sector may exclude useful relationships, while searching…
This function creates a synthetic binary classification dataset for studying feature importance and redundancy in an asset-management machine-learning context. It first generates informative and noise features, then constructs additional redundant features…
This module describes a candidate-selection process for pairs trading based on dimensionality reduction and clustering. It starts from a panel of asset prices, converts prices to returns, standardizes them, and applies principal component analysis to create…
This abstract copula framework provides shared methods for bivariate copula implementations, with named families including Archimedean, Gaussian, and Student forms. It evaluates copula density and cumulative joint probability, and calculates a conditional…
This overview introduces neural networks as flexible models for financial prediction and describes multilayer perceptrons, recurrent networks with LSTM cells, and higher-order neural networks. It explains how input, hidden, and output layers combine…
This Python class appends expanded values to a tabular dataset using polynomial bases or feature products. Its available polynomial families are Chebyshev, Legendre, Laguerre, and ordinary powers; the requested degree controls how many orders are generated.…
This data-preparation module builds time-series inputs for a deep-learning momentum model. It reads close prices, clips extreme values using an exponentially weighted mean and standard deviation, then derives daily returns and volatility. The target is a…
This overview introduces the Transformer architecture from the paper “Attention Is All You Need.” Earlier sequence-to-sequence systems commonly used recurrent or convolutional networks, often combined with attention. The Transformer instead relies on…