2 views (last 30 days)

John D'Errico
on 26 Oct 2017

Edited: John D'Errico
on 26 Oct 2017

In general, NO. This is impossible to do, to infer the real function that lies beyond some data.

If you have function values, they are never exactly the true values anyway. For example,

x = linspace(0,1,8)

x =

Columns 1 through 6

0 0.142857142857143 0.285714285714286 0.428571428571429 0.571428571428571 0.714285714285714

Columns 7 through 8

0.857142857142857

Is x(2) exactly 1/7 anyway? NO! x(2) is a floating point approximation to 1/7. The true number is a infinite decimal, never terminating. But x(2) is just an approximation.

y = x.^2

y =

Columns 1 through 6

0 0.0204081632653061 0.0816326530612245 0.183673469387755 0.326530612244898 0.510204081632653

Columns 7 through 8

0.73469387755102 1

Again, even something as simple as this has values that are NOT exactly represented. x(2) is NOT 1/49. It is only an approximation.

sprintf('%0.55f',y(2))

ans =

'0.0204081632653061208204636756136096664704382419586181641'

vpa(sym('1/49'))

ans =

0.020408163265306122448979591836735

As you can see, they are not the same.

So you cannot even store those numbers. Now, can you find a function that will predict not only the approximate values, but also somehow magically know that you really intended to have the true values behind those approximations?

How could any tool be intelligent enough to do so? Software cannot do this. I've heard of tools that try. They don't do it well.

Worse, for any given set of points, there are infinitely many functions that will pass through any set of points. So even if you did find "THE" function that represents your data, there are infinitely many alternative functions that will predict that data EXACTLY as well. Which one is correct?

At best, you can intelligently provide a model that represents this relationship. It is best if your model comes from physical principles that model the relation. Then you use a regression tool to estimate the parameters of that model.

Opportunities for recent engineering grads.

Apply TodayFind the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
## 0 Comments

Sign in to comment.