Generalized Least Squares Error & Weights
2 ビュー (過去 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.
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!