# Thread: Numeric analysis and approximation

1. ## Numeric analysis and approximation

Hi, Im not sure wether this question is under right area.

I have a problem, in a field on numeric analysis. I'm trying to understand pragmatically interpolation and extrapolation and other techniques related to approximation.

Suppose my measure device has logged two data which are related each other, I call the data as x and y.

logged data:
x: {1,3,5,8,25,33}
y: {4,16,36,81,676,1156}

Ok, now I have to somehow approximate a function to calculate (approximate) values inside x-area and outside x-area.
For example, what is value of y when x = 4 and when x = 101.

How the interpolation and extrapolation works in this case and if there is a general function f(x). And how to get that function from measured points?

Could you math pros help me on this?

2. Originally Posted by tabularasa
Hi, Im not sure wether this question is under right area.

I have a problem, in a field on numeric analysis. I'm trying to understand pragmatically interpolation and extrapolation and other techniques related to approximation.

Suppose my measure device has logged two data which are related each other, I call the data as x and y.

logged data:
x: {1,3,5,8,25,33}
y: {4,16,36,81,676,1156}

Ok, now I have to somehow approximate a function to calculate (approximate) values inside x-area and outside x-area.
For example, what is value of y when x = 4 and when x = 101.

How the interpolation and extrapolation works in this case and if there is a general function f(x). And how to get that function from measured points?

Could you math pros help me on this?
The picture looks very much like a parabola $\displaystyle y = x^2 + b x + c$ (in the attached picture, I graphed $\displaystyle y = x^2$). Do you know the method of least squares?

3. Thanks for your answer but, yes I know the function, my question is actually how actually come to conclusion by math way. I'm looking for example for interpolating and extrapolating...revealing the function that makes those x and y values. Instead of using tools, using pure math to get the function, not drawing a graph and looking from it.

4. Originally Posted by tabularasa
Thanks for your answer but, yes I know the function, my question is actually how actually come to conclusion by math way. I'm looking for example for interpolating and extrapolating...revealing the function that makes those x and y values. Instead of using tools, using pure math to get the function, not drawing a graph and looking from it.
One thing you can do is consider

$\displaystyle (1)\;\;\;y = ax^2 + bx + c$

and pick three pairs of numbers near $\displaystyle x = 4$, say

$\displaystyle (1,4),\; (3,16),\; (5,36)$ and substitute them into (1). This gives three equations for $\displaystyle a, b \; \text{and} \;c$, i.e.

$\displaystyle a + b + c = 4,$
$\displaystyle 9a + 3b + c = 16,$
$\displaystyle 25a + 5b + c = 36,$

Solving gives $\displaystyle a = 1,\; b = 2,\; c = 1$

so

$\displaystyle y = x^2 + 2x + 1 = (x+1)^2$

Notice that all of the numbers fit perfectly. Then let $\displaystyle x = 4$.

5. Ah, nice! Linear polynominal approximation. Thanks. That's im looking for.