필터 지우기
필터 지우기

Generalized Least Squares Error & Weights

조회 수: 2 (최근 30일)
KKR
KKR 2012년 12월 19일
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

답변 (1개)

Matt J
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
KKR
KKR 2012년 12월 20일
Great thank you very much for your response. That means, I should come up with a better weighting scheme, correct? I know the classic literature suggest to use the inverse of variances as weights, however the variances are usually not known for the observations. Any idea to get proper weights?
Matt J
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 CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by