Least Absolute Value based regression
Show older comments
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!
Accepted Answer
More Answers (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 Comments
It uses whichever one of linprog's algorithms you select in the options input. The default, I believe, is 'dual-simplex'.
NA
on 8 Nov 2021
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
on 8 Nov 2021
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
on 8 Nov 2021
I think, but how can I use this objective function?
Matt J
on 8 Nov 2021
Well, it's just a direct application of minL1lin with
C = inv(R)^0.5 * A;
d = inv(R)^0.5 * y;
NA
on 9 Nov 2021
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
on 9 Nov 2021
If W is dagonal, then yes, it's true.
NA
on 10 Nov 2021
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?
Categories
Find more on Fit Postprocessing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!