I want to interpolate any function $f(x)$ using only linear interpolation. So far I have found that the following equations do the trick pretty well. $$m(a,b,x)=\frac {f(b)-f(a)}{b-a}(x-a)+f(a)$$ $$L(a,b,x)=(a-x)(x-b)$$ $$T(x)=\frac 12(1+\mathrm {sign} (x))$$ $$F(x)=\sum_{n=1}^\infty m(v+(n-1)h,v+nh,x)T(L(v+(n-1)h,v+nh,x))$$ Where $h$ is the size of the intervals on which the function is interpolated, it can easily be stated that $F(x) \to f(x)$ as $h \to 0$. The error between both interpolations can be found with: $$R=f(x)-F(x)$$ However, I was thinking that maybe there is a function of $R$ that could maximize $h$ within an interval $[a,b]$, i.e. given the error $R$, what is the biggest $h$ that could yield that $R$ within an interval $[a,b]$?
Asked
Active
Viewed 633 times
0
-
To even approach this, you would need to have some conditions on $f$. – copper.hat Oct 31 '15 at 18:58
-
which ones? maybe i can edit the question – GuPe Oct 31 '15 at 19:32
-
It depends on what you are trying to achieve. Do you have some application in mind? – copper.hat Oct 31 '15 at 20:22
-
working with lines is so much easier than working with curves, especially when dealing with diophantine equations. Mostly, I want to approximate any function $f(x)$ to count the number of solutions to diophantine equations of the sort $\sum_{n=1}^m \lfloor f(x_n) \rceil=N$. This optimization will ease the computations for the purpose of graphing the solutions. – GuPe Oct 31 '15 at 21:08
-
Surely the graphing software can deal with polynomials directly? – copper.hat Oct 31 '15 at 21:16
-
sure it can, but I can't, and I would like to work with lines rather than curves – GuPe Oct 31 '15 at 21:18
-
Are you trying to solve the following semi infinite program? $\max{ h | |f(a+th)-(f(a)+t(f(b)-f(a))| \le R, \ \forall t \in [0,1] }$? – copper.hat Oct 31 '15 at 21:34
-
I don't know what semi infinite programs are – GuPe Oct 31 '15 at 23:09
-
The $t $ takes values in $[0,1]$ rather than a finite set. If you just need an approximation, a LP will suffice for $t ={ k\over n}$, $ k=0,...n$ or similar. – copper.hat Oct 31 '15 at 23:28
-
And how do I solve these programs? Will the solution give me the optimization of $h$ as a function of $R$? – GuPe Nov 02 '15 at 06:40