Re: [eigen] inverse() method for TriangularView class?
• To: eigen@xxxxxxxxxxxxxxxxxxx
• Subject: Re: [eigen] inverse() method for TriangularView class?
• From: Douglas Bates <bates@xxxxxxxxxxxxx>
• Date: Mon, 31 Oct 2011 14:22:08 -0500
• Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=7cWGA39QAkttrnor9dNHEWjxkAtzNX9cCqbw1F0A8CU=; b=AGgQ+fUgaeeLwr851qd0UBnhQBhtgpibUu110q87sS/Hk7Gj1Tj7610Bj98Ipa9qIv HVToc1I/gKa2w9Zeg7hpuw36evg2uaicwFXacENTsc6CiCwGKTxyDcGOuGy/RSUthciJ NTUCrY/lW+s4o6BGXPlzSMSNLZWcMTMcZR0gg=

On Mon, Oct 31, 2011 at 1:46 PM, Helmut Jarausch
<jarausch@xxxxxxxxxxxxxxxxxxx> wrote:
> On 10/31/2011 06:10:16 PM, Douglas Bates wrote:
>> In my case it is not that I want to use the inverse to form solutions
>> of systems.  I actually want the inverse and at present am applying
>> solve to the identity matrix to obtain it.  My proposal for an
>> inverse
>> method is simply to make my code more concise and transparent.
>>
>> A common operation in statistical computing is solving a least
>> squares
>> problem, $\hat{\beta}=\arg\min_{\beta}\|y - X\beta\|$ and calculating
>> the standard errors of the estimated coefficients.  That calculation
>> requires the square roots of the diagonal elements of X'X.  If you
>
> Isn't it more stable to use the SVD of X = U S V'  (S diagonal)
> Then (X'X)^(-1)= V S^(-2) V'

You can use the SVD but, depending on the size of the model matrix, X,
the SVD can be much, much slower than using a LDLT decomposition of
X'X.  The latter method does involve calculating X'X whose condition
number is the square of the condition number of X, which is a
disadvantage.  But even if you don't want to form X'X you could use a
column-pivoted QR decomposition to get close to the speed of the
Choleksy decomposition.  And both are much faster than the SVD on
large examples.



 Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/