apaMeanVariance.Transform.Turnover(ExpectedReturns, Covariances, LowerBounds, UpperBounds, PortfolioExposure, CurrentWeights, BuyCosts, SellCosts, TradeVariance, OutputType)
=apaMeanVariance.Transform.Turnover(ExpectedReturns, Covariances, LowerBounds, UpperBounds, PortfolioExposure, CurrentWeights, BuyCosts, SellCosts, TradeVariance, OutputType)Result
Returns one input of a bounded mean-variance problem with current weights w0 and proportional transaction costs, transformed so that it can be solved with the apaMeanVariance.Restricted.Bounded.Weights functions and apaMeanVariance.Restricted.Bounded.Frontier. Each function of the transformed problem receives the transformed ExpectedReturns, Covariances, LowerBounds, UpperBounds and PortfolioExposure, i.e. this function is called once per OutputType. The results are converted back into final weights, trades or turnover with apaMeanVariance.Transform.Turnover.Collapse.
Syntax
ExpectedReturns: 1 x n vector with expected constituent returns
Covariances: n x n covariance matrix
LowerBounds: 1 x n vector with lower bounds of the final constituent weights
UpperBounds: 1 x n vector with upper bounds of the final constituent weights
PortfolioExposure: total exposure of the final portfolio, i.e. the sum of the final constituent weights
CurrentWeights: 1 x n vector with the current constituent weights w0; the final weights are w0 plus the trades
BuyCosts: optional; proportional costs per unit bought, a single value or a 1 x n vector, in the units of ExpectedReturns (e.g. round-trip costs amortized over the holding period); must be non-negative; default: 0
SellCosts: optional; proportional costs per unit sold, a single value or a 1 x n vector, in the units of ExpectedReturns; must be non-negative; default: 0
TradeVariance: optional; positive variance added per squared unit bought or sold, i.e. a quadratic market-impact penalty, which keeps the transformed covariance matrix positive definite; default: 1E-6 x mean asset variance
OutputType: optional; 0 transformed ExpectedReturns (1 x (2n + 1)), 1 transformed Covariances ((2n + 1) x (2n + 1)), 2 transformed LowerBounds, 3 transformed UpperBounds (both 1 x (2n + 1)), 4 transformed PortfolioExposure; default: 0
Algorithm
The final weights are written as w = w0 + p + s with buys p >= 0 and sells s <= 0. The transformed problem has 2n + 1 variables: the current portfolio x0 fixed at 1, the n buys and the n sells. Its expected returns are (e'w0, e - BuyCosts, e + SellCosts), so that the expected return of a transformed portfolio is the expected return of the final portfolio net of the transaction costs. The transformed covariance matrix is the covariance matrix of the final portfolio expressed in these variables, [[w0'Σw0, w0'Σ, w0'Σ], [Σw0, Σ, Σ], [Σw0, Σ, Σ]], plus TradeVariance on the diagonal of the buy and sell blocks.
The bounds of x0 are [1, 1]. The buys are bounded by [max(0, LowerBounds - w0), max(0, UpperBounds - w0)] and the sells by [min(0, LowerBounds - w0), min(0, UpperBounds - w0)], so that the final weights respect LowerBounds and UpperBounds, also if a current weight lies outside its bounds. The transformed PortfolioExposure is 1 + PortfolioExposure - sum(w0).
Because buying and selling the same asset costs BuyCosts + SellCosts > 0, the optimal solution never buys and sells the same asset. With zero costs, TradeVariance determines the split.
Remarks
The transformed problem is solved exactly by the FromRiskTolerance, FromReturn, FromVolatility, MVP, MRP and MSR variants of apaMeanVariance.Restricted.Bounded.Weights and by apaMeanVariance.Restricted.Bounded.Frontier, also with linear constraints (A, pick matrices) and a quadratic constraint (Q, c) on the 2n + 1 transformed variables. A linear row a'w on the final weights becomes the row (a'w0, a', a') on (x0, buys, sells). A turnover limit sum|w - w0| <= L is the row (0, 1, ..., 1, -1, ..., -1) with UpperValues L; with CurrentWeights equal to zero, the same row limits the gross exposure sum|w|. A tracking-error cap (w - wb)'Σ(w - wb) <= c becomes Q = M'ΣM with the n x (2n + 1) matrix M = [w0 - wb, I, I]; add TradeVariance to the diagonal of the buy and sell blocks of Q, because the quadratic solver can fail on the exactly singular M'ΣM.
The volatilities and expected returns returned by functions solving the transformed problem include TradeVariance and are net of transaction costs. For the volatility of the final portfolio without TradeVariance, supply Covariances to apaMeanVariance.Transform.Turnover.Collapse. Volatilities are sample or population volatilities as Covariances is.
A long-short portfolio with L1 penalty, such as a box-robust mean-variance problem with return uncertainty δ, follows with CurrentWeights equal to zero and BuyCosts = SellCosts = δ.
