フィルターのクリア

Weighted least squares (WLS) for linear system of equation

12 ビュー (過去 30 日間)
Sebastian Ciuban
Sebastian Ciuban 2015 年 1 月 13 日
編集済み: mahmood hassan 2018 年 11 月 10 日
Hello there, I have a issue in building the Weighted Matrix for my next system of equations:
2x+y=2
-x+3y=1
x+2y=3
A=2 1 b=2
-1 3 1
1 2 3
And I can solve this by means of OLS But my means of WLS I have this formulas from a book:
b=Ax+e
e=b-Ax
C=e*e' % (covariance_matrix)
W=C^-1 % (weight matrix)
But the thing is det(C)=0 and and thus, the inverse it does not exist and I don't think the last 2 formulas for C and W are correct. Can someone explain to me step by step how to build the Weight Matrix just having the matrix A and b? I know this my be too simple but I need a little bit of guidance.
Thank you in advance
*NOTE: 1). I have read the theory regarding WLS and its rational approach. But I understand faster with a practical example, step by step.
2). I would like not to use any matlab-built in functions (for the sake of learning).

回答 (2 件)

Wenwen He
Wenwen He 2016 年 8 月 8 日
Hello,have you solved this question?
  2 件のコメント
Sebastian Ciuban
Sebastian Ciuban 2016 年 8 月 8 日
編集済み: Sebastian Ciuban 2016 年 8 月 8 日
Well some time passed since I have put the question and things got more clear regarding Estimation Theory. I don´t think my question is quite correct but if you have an answer I would be more than happy to accept it to this topic :).
Wenwen He
Wenwen He 2016 年 8 月 8 日
As a matter of fact, I just had the same problem: I calculated the weight matrix by the way of {e=b-Ax; C=e'*e; W=C^-1; }. But, a lot of inf values appear in the matrix W. So, I don't know how to calculate the matrix W. Have you found some good answer about how to obtain the correct weight matrix? If you have found, could you tell me that? Thank you very much!

サインインしてコメントする。


mahmood hassan
mahmood hassan 2018 年 11 月 10 日
編集済み: mahmood hassan 2018 年 11 月 10 日
Hi, According to Wikipedia the Weighted least squares (WLS), is a generalization of ordinary least squares and linear regression in which the errors covariance matrix is allowed to be different to an identity matrix. WLS is also a specialization of generalized least squares in which the above matrix is diagonal. https://en.wikipedia.org/wiki/Weighted_least_squares
if you use this it will not goes to the singularity
  • b=Ax+e
  • e=b-Ax
  • C=diag(e*e') % (covariance_matrix)
  • W=diag(C)^-1 % (weight matrix)

カテゴリ

Help Center および File ExchangeRegression Tree Ensembles についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by