# Which Maximum Diversification Approach in MATLAB is correct?

I am currently trying to find the portfolio weights of the Maximum Diversification Portfolio and found two approaches which result in different outcomes.

The first one is based on this paper:https://www.tobam.fr/wp-content/uploads/2014/12/TOBAM-JoPM-Maximum-Div-2008.pdf

Here I first calculate the assets weights in of synthetic assets and then covert them to an portfolio of real assets. According to the paper there is the possibility of being long or short in cash, but since I want to be fully invested in the risky assets I scale the weights to 1. My question is if this would be "allowed" without changing the optimization problem?

This is the objective function that I minimize:

function fval = md(corMat,w_md)

fval = w_md'*corMat*w_md;

end


And this is the optimization:

T = readtable('Data_test.xlsx');

mon_ret= tick2ret(T{:,3:end});

numReturns = size(mon_ret,1);

covMat  = cov(mon_ret) ;
[corMat, std] = corrcov(covMat);

port_size = length(covMat) ;

Aeq = ones(1,port_size);
Beq = 1;

lbnds = zeros(1,port_size);
ubnds = ones (1,port_size);

n1 = 1.0/port_size;
w0 = repmat(n1, port_size, 1) ;

mdfunction = @(w_md) md(corMat, w_md);
w_md = fmincon(mdfunction, w0, ...
[], [], Aeq, Beq, lbnds,       ubnds, []) ;

w_md = w_md./std;
w_md = w_md/sum(w_md);


The second approach is from this paper(p.21): http://www.qminitiative.org/UserFiles/files/FroidureSSRN-id1895459.pdf

I think I solved it accordingly with this approach:

Objective Function:

function fval = md2(covMat, w_md2)

fval = w_md2'*covMat*w_md2;

end


Non Linear Constraint:

function [c,ceq] = nlcon(w_md2,std)

c =[];
ceq = sum(w_md2'.*std)-1;

end


and the optimization:

md2function = @(w_md2) md(corMat, w_md2);

w_md2 = fmincon(md2function, w0, ...
[], [], Aeq, Beq, lbnds, ubnds, []) ;

w_md2 = w_md2/sum(w_md2);


Does anybody know which approach is correct or where my mistake is?

I`d appreciate every help!

Best regards

• Can you give numerical values for a (preferably small) MDP problem for which the two codes give different values. Then other people can run it on their own code and see which answer they get. – Alex C Apr 24 '19 at 20:14
• Is there a way to upload an file? The smallest problem with significantly different values is for 8 returns and 7 assets, which would be quite a lot to type in. – Dirty Dan Apr 24 '19 at 21:11

Is the formula for code #1 $$\max D(S)=\frac{S^{\top}\Sigma_S}{\sqrt{S^{\top}V_S S}}$$?
or is it $$\max D(S)=\frac{1}{\sqrt{S^{\top}V_S S}}$$ s.t. constraints $$\Gamma$$? Both appear on the same page, 41, in paper #1.
and is formula for code #2 $$\min \frac{1}{2}\mathbf{w}^{\top}\Sigma\mathbf{w}$$ s.t. $$w_i\geq 0$$, $$\mathbf{w^{\top}}\boldsymbol{\sigma}=1$$ from paper #2's appendix?