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;


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;


Non Linear Constraint:

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

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


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

  • $\begingroup$ 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. $\endgroup$
    – Alex C
    Commented Apr 24, 2019 at 20:14
  • $\begingroup$ 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. $\endgroup$
    – Dirty Dan
    Commented Apr 24, 2019 at 21:11

1 Answer 1


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?

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.