# Re: [R] minimization a quadratic form with some coef fixed and some constrained

From: Berwin A Turlach <berwin_at_maths.uwa.edu.au>
Date: Thu 10 Aug 2006 - 11:56:50 EST

```    YX> Thanks for reply! But I think that solution is right without
YX> the constrain b'b=1. With this constrain, the solution is not
YX> so simple. :(
```

But simple enough. :)

Write down the Lagrange function for the problem. Say, 'lam' is the Lagrange parameter for enforcing the constraint b'b=1. Then, using Rolf's notation:

RT> [...] Write M as

RT> | M_11 c |
RT> | c' m |

Then the system of equations that b and the Lagrange parameter have to fulfill is:

b = (M_11 + lam*I)^{-1} c (with I being the identity matrix) and lam = b' M_11 b - b'c

You can either use the first equation and do a (grid) search for the value of 'lam' that gives you b'b=1 (could be negative!), or start with lam=0 and then alternate between the two equations until convergence.

At least I think that this will solve your problem. :) Thinking a bit about the geometry of the problem, I actually believe that if c=0, you might have an identifiability problem, i.e. there are at least two solutions, or, depending on M_11, infinitely many.

Hope this helps.

Cheers,

Berwin

• Full address ============================ Berwin A Turlach Tel.: +61 (8) 6488 3338 (secr) School of Mathematics and Statistics +61 (8) 6488 3383 (self) The University of Western Australia FAX : +61 (8) 6488 1028 35 Stirling Highway Crawley WA 6009 e-mail: berwin@maths.uwa.edu.au Australia http://www.maths.uwa.edu.au/~berwin

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu Aug 10 12:01:26 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 11 Aug 2006 - 02:21:09 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.