# 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

Quantitative Finance Asked by Dirty Dan on November 17, 2021

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}Sigmamathbf{w}$$ s.t. $$w_igeq 0$$, $$mathbf{w^{top}}boldsymbol{sigma}=1$$ from paper #2's appendix?

If so, the 2nd formula has a non-negativity constraint, making it the short-sale constrained MDP, which might be why it doesn't correspond to the 1st, if the 1st is the unconstrained MDP.

Answered by develarist on November 17, 2021

## Related Questions

### Difference between Order Expire and Order Done for Day (DFD)

1  Asked on August 21, 2020 by abnv

### How to download full daily historical data of MSCI AC Asia Index

1  Asked on August 13, 2020 by monicam

### Implied Volatility from Heston Model

1  Asked on August 3, 2020