Hello,
Please, I would like to see how I can use lsqnonlin together with the MultiStart solver to search over many initial points automatically and find the global solution of the portfolio optimization problem below.
I am using lsqnonlin to solve the following system for the n-order vector w and the scalar lambda. There is only a lower bound constraint at 0 for each element of w (short-selling constraint).
x0=[1/n*ones(n,1);1]; lb=[zeros(n,1);0]; [w phi]=lsqnonlin(@sub,x0,lb); function fcns=sub(x) w=x(1:n,1); lambda=x(n+1,1); fcns(1:n,1)=lambda^(-1)*covmat^(-1)*(meanbl-(vec1'*covmat^(-1)*vec1)^(-1)*(vec1'*covmat^(-1)*meanbl-lambda)*vec1)-w; fcns(n+1,1)=w'*meanbl+phi*sqrt(w'*covmat*wb)-H;
Where the scalars H and phi, the n-order vectors meanbl and vec1, and the nxn matrix covmat are known.
I did not really understand the example at http://www.mathworks.com/help/gads/multistart-using-lsqcurvefit-or-lsqnonlin.html where the local solver used with MultiStart is lsqcurvefit instead of lsqnonlin.
Thank you very much.
Best wishes.
Best Answer