Building a Constrained Tangency Portfolio and Capital Market Line
Summary
The document presents an attempted mean-variance optimization workflow for a portfolio with lower and upper bounds on asset weights. It first uses a quadratic program to find a global minimum-variance portfolio subject to a budget constraint. It then sketches a way to trace portfolios relative to a risk-free rate by imposing target excess-return constraints and solving another quadratic program across a range of targets.
The supplied MATLAB-style snippet shows the inputs and constraints the author is using, but it does not include a response explaining whether the method correctly produces a capital market line or tangency portfolio. Important details are missing, including the objective used in the optimization, the precise weight constraints, and how portfolio risk and return are calculated for each solution. The material is therefore a partial implementation example rather than a validated derivation, and it gives no numerical results or performance evidence.
Key ideas
- The proposed workflow uses quadratic programming for bounded mean-variance portfolios.
- The global minimum-variance portfolio is computed subject to a full-investment constraint.
- The code sketches a sweep over target excess returns relative to a risk-free rate.
- The document does not establish that the proposed sweep correctly derives a tangency portfolio or capital market line.
- The optimization objective and validation results are not provided.
Tags
Full text
# Tangency portfolio with constraints
# Tangency portfolio with constraints
Hello to everyone I am trying to implement a version of MV optimization with constraints as UB and LB, it seems to work fine but now i was trying to figure out a simple way to derive a CML in the same fashion.
Here it is my code so far. I am looking for some hints on how to practically implement it.
```
%% GMV in a LO portfolio
AGMV = [UNO']
BGMV = [1]
[WGMVLO(:,1), VARGMV] = quadprog(SIGMA,[],[],[],AGMV,BGMV,LBLO,UBLO,[],opts)
MUGMV = MU*WGMVLO(:,1)
STDGMV = sqrt(2*VARGMV)
plot(STDLO,MULO,MINSTD,Er,STDGMV,MUGMV,'*')
%%NEW CODE Tangency portfolio
%%Starting with the new assumptions of LO portfolio, it seems reasonable in
%%order to find a new measure of benchmark, the most efficient considering
%%the Rf
ERCML = linspace(Rf,max(MULO)-0.05,N);
MUCML(:,1) = MU'-Rf.*UNO;
ACML = [MUCML']
WCML0=zeros(1,N)
for i=1:N
BCML = [ERCML(1,i)]
[WCMLO(i), VARCML] = quadprog(SIGMA,[],[],[],ACML,BCML,LBLO,UBLO,[],opts)
i=i+1
end
```
// [1]: https://i.sstatic.net/ofqxC.pngShown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.