[R] minimization a quadratic form with some coef fixed and some constrained
Berwin A Turlach
berwin at maths.uwa.edu.au
Thu Aug 10 03:56:50 CEST 2006
>>>>> "YX" == Yingfu Xie <Yingfu.Xie at sekon.slu.se> writes:
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 at maths.uwa.edu.au
Australia http://www.maths.uwa.edu.au/~berwin
More information about the R-help
mailing list