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!