How do I find the global minimum variance portfolio?

24 views (last 30 days)
Calum Crichton
Calum Crichton on 31 Jan 2016
Hi everyone,
Just wondered how you find the GMV portfolio? I have used this code but I wondered if there was another way?

Answers (1)

Alejandra Pena-Ordieres
Alejandra Pena-Ordieres on 3 Dec 2021
Hi Calum,
I understand that you want to find the minimum variance portfolio. You can do this in two ways.
1) The easiest way is to use the Portfolio object. Assume that you have the mean (mu) and covariance (Sigma) of the returns. Then, you can find the minimum variance portfolio like this:
% Define Portfolio object
p = Portfolio('AssetCovar',Sigma,'AssetMean',mu);
p = setDefaultConstraints(p); % Long-only fully-invested portfolio
% Find minimum variance portfolio
w = p.estimateFrontierLimits('min');
Here ( ) you can find a list of the portfolio optimization problems that can be solved using the Portfolio object.
2) The second way is to write an optimization problem and solve it:
% Portfolio problem
prob = optimproblem('ObjectiveSense','minimize');
% Variables
% Portfolio weights
x = optimvar('x',nAssets,1,'LowerBound',0); % x >= 0 (long-only portfolio)
% Objective
% min x'*Sigma*x (Variance)
prob.Objective = x'*Sigma*x;
% Constraints
% Sum of weights equal to 1 (fully-invested)
prob.Constraints.sumToTau = sum(x) == 1;
% Solve problem
sol = solve(prob);
w = sol.x;
Hope this helps!

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by