Lissi
unread,Aug 6, 2013, 2:13:57 PM8/6/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to yal...@googlegroups.com
Hello again!
I have a problem concerning the robust markowitz implementation. Usually, there are two uncertainty sets over the return vector and the covariance matrix considered. But in this case I am using an uncertainty set over the return vector and the second moment Gamma instead of Sigma. I should look like: gamma_l <= Gamma <= gamma_u.
Anyhow when I try to implement the uncertainty set over Gamma I get the result: matrix badly scaled. I tried to implement it the way on the page of the lyaponuv function. That way the uncertainty isn't in the Gamma-matrix, but in the matrix B. What did I do wrong?
Sorry, I am bothering again, but I simply don't know what to do.
% test data
mu_t = [0.05; 0.11; 0.16; 0.16];
Cor_t = [1.0 0.1 0.7 -0.1;
0.1 1.0 -0.2 0.4;
0.7 -0.2 1.0 0.3;
-0.1 0.4 0.3 1.0];
Sigma_t = [ 0.025 0.00055 0.0056 0.00125;
0.00055 0.0121 -0.00352 0.011;
0.0056 -0.00352 0.0256 0.012;
0.00125 0.011 0.012 0.027];
% definition of the constants
ab = 0.05;
n = length(mu_t);
R = mean(mu_t);
% upper and lower bound for Sigma
Sigma_l = Sigma_t - ab*Sigma_t;
Sigma_u = Sigma_t + ab*Sigma_t;
% upper and lower bound for mu
mu_l = mu_t - ab*mu_t;
mu_u = mu_t + ab*mu_t;
% upper and lower bound for Gamma
Gamma_t = Sigma_t + mu_t*mu_t';
Gamma_l = Sigma_l + mu_l*mu_l';
Gamma_u = Sigma_u + mu_l*mu_l';
% Definition of the variables
Gamma = sdpvar(n,n);
w = sdpvar(n,1);
mu = sdpvar(n,1);
sdpvar t;
% Definition of the variables (full matrix variables)
Gammahat = [Gamma, w; w', 1];
Muhat = [mu*mu', mu; mu', 1];
What = [w*w', w; w', 1];
%constraints on the portfolio
W = [sum(w) == 1, w >= 0, mu'*w >= R];
% uncertainty set over mu
M = [mu_l <= mu <= mu_u, uncertain(mu)];
% uncertainty set over Gamma
sdpvar tau;
B1 = zeros(4,4);
B1(1,1) = 1/tau;
G = [-1 <= trace(B1'*Gamma) <= 1];
G = [tau <= -Gamma_l(1,1), tau <= Gamma_u(1,1), uncertain(tau)];
%objective funvtion
objective = w'*(Gamma-mu*mu')*w;
% solving the problem
solvesdp( [W, M, G,objective <= t], t);
double(w)