Numerical Recipes Forum  

Go Back   Numerical Recipes Forum > Numerical Recipes Third Edition Forum > Methods: All Chapters in NR3

Thread Tools Rate Thread Display Modes
Old 08-27-2010, 08:10 PM
ichbin ichbin is offline
Registered User
Join Date: Apr 2009
Posts: 21
Question QR for least squares

I am interested in doing general linear least squares (NR3, 15.4) using QR decomposition. NR mentions this possiblity, but only covers the normal equation and SVD methods in detail.

I have no problem QR decomposing the design matrix and getting the fit parameters. Since the covariance matrix C = (R^T R)^(-1), I can get the covariance matrix by forming R^T R and inverting it explicitly. But Golub and van Loan mention in their problem 5.3.6 that there is a 2/3 n^3 method for overwriting R directly with C. I'm not smart enough to solve their problem by deriving the algorithm. Can someone point out the algorithm in the literature, a textbook, or as code available for perusal?
Reply With Quote
Old 08-29-2010, 03:53 AM
jaje jaje is offline
Registered User
Join Date: Jul 2002
Posts: 55
The method for overwriting R with the upper-triangular part of the variance-covariance matrix is outlined in Björck's "Numerical Methods for Least Squares Problems"; in particular, this page.

Jan M.
Reply With Quote
Old 08-29-2010, 04:44 AM
ichbin ichbin is offline
Registered User
Join Date: Apr 2009
Posts: 21

Thank you! That looks like precisely what I'm looking for.
Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 09:07 AM.

Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.