apaMeanVariance.Restricted.Bounded.Weights.FromRiskTolerance(RiskTolerance, ExpectedReturns, Covariances, LowerBounds, UpperBounds, PortfolioExposure, A, b, LowerPickMatrix, LowerValues, UpperPickMatrix, UpperValues, Q, c, DoShowVolRetOtherwiseWeightsOnly)
=apaMeanVariance.Restricted.Bounded.Weights.FromRiskTolerance(RiskTolerance, ExpectedReturns, Covariances, LowerBounds, UpperBounds, PortfolioExposure, A, b, LowerPickMatrix, LowerValues, UpperPickMatrix, UpperValues, Q, c, DoShowVolRetOtherwiseWeightsOnly)Result
Returns the 1 x n weights (optionally preceded by the portfolio volatility and expected return) of the restricted and bounded mean-variance efficient portfolio for a given risk tolerance, i.e. the portfolio that maximizes RiskTolerance * e'w - w'Σw, with optional linear equality and inequality constraints and an optional quadratic constraint w'Q*w <= c.
Syntax
RiskTolerance: risk tolerance. Equals zero for the minimum variance portfolio (i.e. the portfolio of the most risk-averse investor) and increases until the maximum return portfolio is reached (i.e. the portfolio of the least risk-averse investor)
ExpectedReturns: 1 x n vector with expected constituent returns
Covariances: n x n covariance matrix. Singular matrices are allowed if the efficient portfolios are unique, e.g. zero-variance cash assets
LowerBounds: 1 x n vector with lower constituent exposure bounds
UpperBounds: 1 x n vector with upper constituent exposure bounds
PortfolioExposure: value of the equality constraint on total portfolio exposure, i.e. the sum of constituent exposures
A: optional; m x n matrix of the linear equality constraints A*w = b, with m the number of equality constraints; supplied together with b; default: no equality constraints
b: optional; vector of the m values of the equality constraints A*w = b, supplied together with A; default: no equality constraints
LowerPickMatrix: optional; mL x n matrix of the inequality constraints LowerPickMatrix*w >= LowerValues, e.g. minimum group weights; supplied together with LowerValues; default: no lower inequality constraints
LowerValues: optional; vector of the mL lower constraint values, supplied together with LowerPickMatrix; default: no lower inequality constraints
UpperPickMatrix: optional; mU x n matrix of the inequality constraints UpperPickMatrix*w <= UpperValues, e.g. maximum group weights or a limit on the short book; supplied together with UpperValues; default: no upper inequality constraints
UpperValues: optional; vector of the mU upper constraint values, supplied together with UpperPickMatrix; default: no upper inequality constraints
Q: optional; n x n symmetric positive semidefinite matrix of the quadratic constraint w'Q*w <= c, e.g. a tracking error covariance matrix, or the identity matrix for a concentration limit; supplied together with c; default: no quadratic constraint
c: optional; upper limit of the quadratic constraint w'Q*w <= c, e.g. the squared tracking error, or 1/(effective number of assets) for Q = identity matrix; supplied together with Q; default: no quadratic constraint
DoShowVolRetOtherwiseWeightsOnly: optional; TRUE returns a 1 x (n + 2) row with the portfolio volatility sqrt(w'Σw), calculated from Covariances and therefore a sample or population volatility as Covariances is, the portfolio expected return e'w, and the n constituent weights; FALSE returns the 1 x n weights only; default: FALSE
Algorithm
The solver depends on the optional constraints supplied. Without any optional constraint, the corner portfolios are calculated with the bounded critical line algorithm of apaMeanVariance.Restricted.Bounded.Frontier. With linear constraints only, the corner portfolios are calculated with the critical line algorithm generalized to linear equality and inequality constraints, following Niedermayer and Niedermayer, as in apaMeanVariance.Restricted.Bounded.Frontier.Axb. In both cases, the frontier is linear in the weights between two adjacent corner portfolios w(k) and w(k + 1): w(t) = w(k) + t d with d = w(k + 1) - w(k) and 0 <= t <= 1, its expected return R(t) = R(k) + t e'd is linear and its variance V(t) = V0 + L t + Q t² quadratic in t, with V0 = w(k)'Σw(k), L = 2 w(k)'Σd and Q = d'Σd. Without a quadratic constraint, the objective RiskTolerance * R(t) - V(t) is maximized exactly on every segment, at t = (RiskTolerance * e'd - L) / (2Q) clipped to [0, 1], and the best segment portfolio is returned.
With Q and c, the quadratic constraint is handled by an exact homotopy: for θ in [0, 1], the critical line algorithm is applied to the trace-normalized matrix (1 - θ)Σ + θQ, subject to the bounds, the exposure constraint and the optional linear constraints. Where the quadratic constraint is slack, the frontier portfolio of θ = 0 (no quadratic constraint) is optimal. Otherwise θ is found by a safeguarded secant search such that w'Q*w = c at the target return, which gives the exact optimum of the constrained problem; θ/(1 - θ) is the multiplier of the quadratic constraint. The minimum variance and maximum return portfolios are determined taking the quadratic constraint into account. The variance V(r) of the constrained frontier portfolio with expected return r is convex and non-decreasing between the minimum variance return rMin and the maximum return rMax. The objective RiskTolerance * r - V(r) is therefore concave in r and is maximized by a golden-section search on r in [rMin, rMax], each candidate being the exact constrained frontier portfolio; the search stops when the return interval is below 1E-12 times rMax - rMin, and the end points rMin and rMax are compared as well.
Remarks
A negative risk tolerance is solved as |RiskTolerance| with the negative expected returns, i.e. it returns a portfolio on the inefficient branch.
The results do not depend on the solver: a non-binding quadratic constraint gives the same portfolio as no quadratic constraint, up to round-off.
Each row of a pick matrix defines one constraint, e.g. a row with ones for the equity constituents and zeros elsewhere limits the total equity weight. Leave A and b empty if only inequality constraints are needed. The equality constraints must be linearly independent, and all constraints must be jointly feasible.
With Q equal to the identity matrix, the quadratic constraint limits the Herfindahl concentration index of the weights, i.e. c = 1/N enforces at least N effective assets.
Pressing Esc aborts the calculation; the function then returns "Calculation aborted by user."
