# I Robust linear estimation to guess parameters

Tags:
1. Jan 13, 2017

### borson

Hi guys!
I am working on a project and I need to perform a robust linear estimation as described here:
https://postimg.org/image/t9b9fybtt/

I have to do this to the equation 43:
https://postimg.org/image/x4eniiuzl/

I have assumed that the final function that I have to minimize, basing on both papers,
is:
Sumatory of Xi*sgn(Yi+(b^2 - (Ymedian-n*Xmedian)^2 )+ n*Xi)

and the median of X and Y data being: VF = median {yi − n*xi}
(I am assuming VF equals to that as it is stated in the 1st pdf ) (with VF being the omega letter.)

then, this function, minimized (by bisection) should give me the n and VF values correctly fixed. However, it doesn't.
this is therefore why I think I am mistaken in something, for instance in the grasping of the problem or the process.

it is supposed to be easy, just minimizing the function I have talked about above by bisection, but as it is giving me uncorrect results, I am really confused. I think I am doing something bad in the process.
Hence, I am questioning "my process" to see where I have failed. So that I have the following points/questions in which I may have failed:
-The equation 43 of the second paper, is the target to initially be minimized. As explained in the paper(the first), I have to turn the "target function" into another function (the one with the sgn) which is now the one I have to minimize. So well, in the first paper it appears with negatives signs in their variables, but as the initially target function (the equation 43 of the 2nd paper) has positive signs, I kept them. I did so, because I assumed that the second paper gave me the function already ready to be minimized by that method, and also, as it is shown in other parts of the pdf (2nd one, but I did not upload that parts), that function (without any summatory nor absolute values of course, but the rest remains the same) equals 0. I supposed that it means that no subtraction/difference of "errors" was required(I mean the calculation tipically used for this kind of problems: real data-calculated/predicted data was not necessary), because the function itself yields 0, so that if the parameters are mistaken, the result won't be 0, so just by minimizing the function in its original way it should work. (or at least this is what I guessed)
Only in the calculation of "VF" (of the difference between the medians) I have used a subtraction.
So this is the first point I am confused about, How should I pose the final function to be minimized (the one with the sgn)?
Should it keep its initial form as shown in the 2nd paper, with the variables summing?, or should I put negatives signs as shown in the 1st paper?.

-In the 1st paper, it states that in order to minimize that function, before using bisection, estimations of the parameters by least-squares have to be done.
I have not done that, nor needed any initial guess of that parameters to do the bisection, I do not see any need of that indeed. Why is it used for? I mean, Why does this paper use this?.
However, I have to say that I do know the interval in which the parameters that should minimize the function lie.

Well, summing up, I have posed the final function to be minimized as follows:
Sumatory of Xi*sgn(Yi+(b^2-(Ymedian-n*Xmedian)^2)+ n*Xi)

with VF = {Ymedian − n*Xmedian}

I use the bisection method, after some iterations it gives me mistaken results.
I use bisection in the following way:
C= (a+b)/2.0; A,B and C are different points of the X axis of the n parameter.
Once C, A and B are equal enough, I stop the iterations-process.
and I assume that n=A=B=C and that, basing on the lasts prescriptions,
Vf= Ymedian-C*Xmedian.

I also leave The java code that I used just in case:
https://postimg.org/image/ode5osstl/

I do not know what is failing
I hope you can help me
thanks for reading !

2. Feb 12, 2017