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

From: Berwin A Turlach <>
Date: Thu 10 Aug 2006 - 11:56:50 EST

>>>>> "YX" == Yingfu Xie <> 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.


        Berwin mailing list PLEASE do read the posting guide 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 Please read the posting guide before posting to the list.