Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
half Of Ravi Varadhan Sent: Tuesday, October 16, 2007 3:18 PM To: 'yoo'; r-help@r-project.org Subject: Re: [R] underdetermined system Here is a solution using SVD: w <- matrix(c(1, 5), ncol=2) sw <- 2 w.svd <- svd(w) sw %*% w.svd$u %*% diag(1/w.svd$d, length(w.svd$d)) %

Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
D] On Behalf Of yoo Sent: Tuesday, October 16, 2007 3:02 PM To: r-help@r-project.org Subject: Re: [R] underdetermined system Turns out someone asked this before ;) http://tolstoy.newcastle.edu.au/R/e2/devel/07/04/2981.html Ravi Varadhan wrote: > > QR is good for overdetermined LS proble

Re: [R] underdetermined system

2007-10-16 Thread Charles C. Berry
> > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of yoo > Sent: Tuesday, October 16, 2007 11:34 AM > To: r-help@r-project.org > Subject: [R] underd

Re: [R] underdetermined system

2007-10-16 Thread yoooooo
MAIL PROTECTED] > > Webpage: http://www.jhsph.edu/agingandhealth/People/Faculty/Varadhan.html > > > > > > > > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > On > Behalf Of yoo > Sent: Tuesday, October 16, 2007 11:34 AM > To: r-

Re: [R] underdetermined system

2007-10-16 Thread Ravi Varadhan
ject.org Subject: [R] underdetermined system Hi, sorry, I'm an idiot.. and I know I'm missing something stupid.. I thought if we solve an underdetermine system with QR, my soln is: min ||x|| (L2 sense) such that Ax = b then say i have: > w <- matrix(c(1, 5), ncol=2) > sw = 2 > qrW =

[R] underdetermined system

2007-10-16 Thread yoooooo
Hi, sorry, I'm an idiot.. and I know I'm missing something stupid.. I thought if we solve an underdetermine system with QR, my soln is: min ||x|| (L2 sense) such that Ax = b then say i have: > w <- matrix(c(1, 5), ncol=2) > sw = 2 > qrW = qr(t(w) %*% w) > qr.coef(qrW, t(w) %*% sw) [,1]