[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: OT: finding the weights used in weighted least squares regression
From: |
James Sherman Jr. |
Subject: |
Re: OT: finding the weights used in weighted least squares regression |
Date: |
Wed, 27 Apr 2011 01:48:53 -0400 |
On Wed, Apr 27, 2011 at 1:19 AM, Kamaraju S Kusumanchi
<address@hidden> wrote:
Ben Abbott wrote:
>
> If I understand what you'd like to do, I think the solution is ...
>
> W = (A*(A\b)-b) ./ (A*x-b)
>
No. This is not the solution. Consider the following example
octave:10> n=5, m=2, W = diag(rand(n,1)), A = rand(n,m), b = rand(n,1), x =
(W*A) \ (W*b), (A*(A\b)-b) ./ (A*x-b)
n = 5
m = 2
W =
0.63718 0.00000 0.00000 0.00000 0.00000
0.00000 0.75466 0.00000 0.00000 0.00000
0.00000 0.00000 0.69982 0.00000 0.00000
0.00000 0.00000 0.00000 0.08992 0.00000
0.00000 0.00000 0.00000 0.00000 0.94621
A =
0.833095 0.568790
0.792483 0.536521
0.702069 0.588282
0.036704 0.529085
0.238762 0.427252
b =
0.86356
0.77943
0.77652
0.98000
0.49344
x =
0.32941
0.97441
ans =
2.07510
-7.79993
2.55568
0.23533
112.87186
Hence W is not same as (A*(A\b)-b) ./ (A*x-b) .
thanks
--
Kamaraju S Kusumanchi
http://malayamaarutham.blogspot.com/
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
This seems like an ill-posed problem to me. (or in other words the answer is no, you can't solve for W or at least not a specific W).
If you're given A, x, and b, then either
1) Ax =b, then no matter what W you choose, left multiplying by W on both sides gives you a true statement WAx = Wb
or
2) Ax ~=b, then if you want to solve for a W such that WAx = Wb, equates to W(Ax-b) = 0, which is to say that as long as Ax-b is in the null space of W (or that Ax-b is an eigenvector with eigenvalue 0) you are free to choose any W that satisfies this condition. This is in essence a linear system with n^2 unknowns (size of W) with only n equations.
- OT: finding the weights used in weighted least squares regression, Kamaraju S Kusumanchi, 2011/04/26
- Re: OT: finding the weights used in weighted least squares regression, Ben Abbott, 2011/04/26
- Re: OT: finding the weights used in weighted least squares regression, Kamaraju S Kusumanchi, 2011/04/27
- Re: OT: finding the weights used in weighted least squares regression, Ben Abbott, 2011/04/27
- Re: OT: finding the weights used in weighted least squares regression, Kamaraju S Kusumanchi, 2011/04/27
- Re: OT: finding the weights used in weighted least squares regression, Ben Abbott, 2011/04/27
- Re: OT: finding the weights used in weighted least squares regression, Kamaraju S Kusumanchi, 2011/04/27
Re: OT: finding the weights used in weighted least squares regression, Mike Miller, 2011/04/28