turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-19-2018 05:56 PM - edited 02-20-2018 11:41 AM

Hello,

I need to minimize this function A = w' * cov * w, where cov is my variance matrix 5x5 and w is my list of parameters i need to chose in order to minimize A so w is a vector 1x5.

I have constraints where the sum of w = 1 and the parameters of w need to be between 0 and 1.

I tried several things but I am a bit lost on IML to do that, if somebody can help me, I have read the SAS IML User Guide with the routine function and some other topics but I didn't really understand completely how to suceed in order to solve my problem.

Thanks you by advance.

Accepted Solutions

Highlighted
## Re: Minimization of objective function with matrix

Options

Solution

02-20-2018
04:46 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to degdeg

02-20-2018 03:33 PM

If w* is the value that minimizes w`*A*w, then w* also minimizes alpha * w`*A*w for all alpha > 0.

If you think back to calculus, you might remember the 1-D analogy: the value of x that minimizes 3(x-2)^2 also minimizes alpha 3(x-2)^2 for all alpha > 0.

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to degdeg

02-19-2018 07:39 PM

Q(w) = w`*A*w is a quadratic function of w. You can use the NLPQUA subroutine to solve this problem, including putting constraints on the parameters. See the article "Quadratic optimization in SAS" for an example and discussion.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

02-20-2018 12:44 PM - edited 02-20-2018 12:46 PM

Thanks you !

So I tried this :

w = J(5,1,0.2);

con = {0 0 0 0 0 . . ,

1 1 1 1 1 . . ,

1 1 1 1 1 0 1};

opt = {0 2};

CALL NLPQUA(rc,wres,nccov,w,opt,con);

And it worked but I'm not sure If it gives me the right wres vector solution of the minimization of w'*A*w where A is nccov.

Instead it gives me the minimization of 0.5*w'*A*w I think, isn't it ?

Thanks you again by advance.

Highlighted
## Re: Minimization of objective function with matrix

Options

Solution

02-20-2018
04:46 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to degdeg

02-20-2018 03:33 PM

If w* is the value that minimizes w`*A*w, then w* also minimizes alpha * w`*A*w for all alpha > 0.

If you think back to calculus, you might remember the 1-D analogy: the value of x that minimizes 3(x-2)^2 also minimizes alpha 3(x-2)^2 for all alpha > 0.