Least Absolute Value based regression
이전 댓글 표시
Hi ,
I want to use linear regression based on least absolute value deviation to find the coefficients of my model with the help of measured data and 3 independent variables. The number of measurements I have are much greater than 3( number of cofficients). I have been trying to implement LAV method for this, but with no success. I need urgent help. Can someone please guide me in this. If someone already has the code for LAV, I would be grateful if you could share it with me.
Thank you!
채택된 답변
추가 답변 (1개)
A quick test shows that it gives your expected answer:
zi = [-3.01;3.52;-5.49;4.03;5.01];
Ai1 = [1;0.5;-1.5;0;1];
Ai2 = [1.5;-0.5;0.25;-1;-0.5];
[xlav,~,res]=minL1lin([Ai1,Ai2],zi)
댓글 수: 12
It uses whichever one of linprog's algorithms you select in the options input. The default, I believe, is 'dual-simplex'.
NA
2021년 11월 8일
I have a regression model like:
Z=Ax+e
[z1;z2;z3] = [A11 A12 A13 A14; A21 A22 A23 A24; A31 A32 A33 A34]*[x1;x2;x3;x4]
where, Z is m*1 vector, A is m*n matrix, and x is n*1 vector.
If we have covariance matrix R (m*m)
In this context,
[xlav,~,res]=minL1lin([A],Z)
But how we use covariance matrix in this function?
NA
2021년 11월 8일
What is the intended computation,
For state estimation.
how would the covariance matrix be involved?
for weighted least square the covariance matrix involved as:
F = A' * inv(R) * (z - z_est);
J = A' * inv(R) * A;
dx = (J \ F);
Yes, but what would be the covariance-weighted objective function that you are considering in the case of L1 minimization? Would it be
norm(inv(R)^0.5 * (A*x-y),1)
NA
2021년 11월 8일
I think, but how can I use this objective function?
Matt J
2021년 11월 8일
Well, it's just a direct application of minL1lin with
C = inv(R)^0.5 * A;
d = inv(R)^0.5 * y;
NA
2021년 11월 9일
I checked the formulation, the weighted least absolute value minimizes this cost function: 
r is the residual vector anf Wj is reciprocal of the covariance of entry j.
If I have W, is this true?
C = W * A;
d = W * y;
Matt J
2021년 11월 9일
If W is dagonal, then yes, it's true.
NA
2021년 11월 10일
Thank you. If we change one of the entry of matrix A, such that
A_d = [A11 A12 A13 A14; A21 4*A22 A23 A24; A31 A32 A33 A34]
When we calculate residuals, how minL1lin removes the entry to find the regression. I mean, what is the threshold level that minL1lin use for regression?
카테고리
도움말 센터 및 File Exchange에서 Fit Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!