Generalized Least Squares Error & Weights
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi Guys,
Hope everyone is doing good. My question is related to using GLS (by function lscov). I have set of independent variables (302 x 6) and dependent variable.
I must mention that this is the first time I am trying GLS (or WLS). I would like to use weights such that I would emphasize those observations that closer to an "average" and penalizing (by less weight) for those which seem to be far or outlier. (I would like to know your input in this approach too).
In order to do that, I devised a weight scheme such the weights add up to 1. And then I ran simpy lscov(A, b, w). Is this right approach? I get warning:
Warning: A is rank deficient to within machine precision. > In lscov at 197
Please let me know if there is something wrong am I doing?
Looking forward to get some serious inputs. Thank you very much in advance.
Kaushal
댓글 수: 0
답변 (1개)
Matt J
2012년 12월 20일
편집: Matt J
2012년 12월 20일
Yes, if you apply small enough weights to informative data, you can make your system look rank deficient, leading to bad results. Example:
>>A=rand(3); b=sum(A,2); w=[1 0 0];
>> rank(A)
ans =
3
>> lscov(A,b)
ans =
1.0000
1.0000
1.0000
but
>> lscov(A,b,w)
Warning: A is rank deficient to within machine precision.
> In lscov at 197
ans =
0
2.0486
0
댓글 수: 3
Matt J
2012년 12월 20일
If you don't suspect your A matrix of being rank deficient, then yes, the weights would be the culprit.
As for how to get the weights, it depends on whether you have multiple observations. If you do, maybe you could use the inverse of the sample variances.
참고 항목
카테고리
Help Center 및 File Exchange에서 Error Detection and Correction에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!