1
$\begingroup$

Hi,

I have a growing, near-linear function, that has some "noise" in its linearity. Is there any solution, how to approximate this function ? I tried Neural Network, but ist not best...

Function example: link to image
http://www.perry.cz/files/almost-linear.png

$\endgroup$
2
$\begingroup$

I'll assume that your data is discrete.

You can pick a class of function such as $g(x)=Ax+B+C\sin(Dx+E)$ and then solve for $A,B,C,D,E$ which minimize $\sum(f(x)-g(x))^2.$

later thoughts As I think about it, that might not be that easy to solve (at least using partial derivatives, perhaps a multi-dimensional Newtons method but that does not seem worthwhile).

Any modeling is a matter of judgement. I think you would in any case first just find the best linear fit $Ax+B$ (which is easy) and then work on the values $f(x)-(Ax+B).$ Now you have the cleaner problem:

Given something which looks like random noise with mean $0$ how would you model it?

Without any further information I might just find average absolute value $V$ of the error and then add a term $(2-{\sqrt{2}})\frac{V}{2}\sin(Mx+M)$ where $M$ is a huge constant. So this is essentially random sampling from a source with mean value $0$ and mean absolute value $V$. This would be expected (I would think) to be roughly no better or worse a fit to your actual data than the line $Ax+B$ but to have the right amount of noisiness.

$\endgroup$
-1
$\begingroup$

Have U tried "least square method"?

$\endgroup$
  • $\begingroup$ It gives me linear function, but without "noise" $\endgroup$ – perry Feb 9 '13 at 13:02
  • $\begingroup$ I don't understand your question... what do U means by approximation? $\endgroup$ – nickname Feb 9 '13 at 14:18
  • $\begingroup$ Function, that is close to original one... but linear is ok only for couple of values, than it breaks due to "steps" in original function $\endgroup$ – perry Feb 9 '13 at 15:06
  • $\begingroup$ y it's not enough 4 u? It's will be a good approximation. If your goal is function with behavior similar the behavior of the input, u can use interpolation methods. $\endgroup$ – nickname Feb 9 '13 at 17:03
  • $\begingroup$ Please don't use these horrible abbreviations!! If you can't write properly, just refrain from writing here at all. $\endgroup$ – Loïc Teyssier Feb 24 '13 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.