Message Boards Message Boards

2 Replies
0 Total Likes
View groups...
Share this post:

Minimising an Interpolation Function

Posted 11 years ago
Hello all,

If I have a list of points (in this case univariate) and I want an interpolation I use Interpolation[{1,2,3,4.....}], but what is the syntax to minimize such a function?

Minimize and FindMinimum both require me to specify the variable with which to minimize my function, but I don't know how to specify a variable for the interpolation.

I'm a Mathematica 9 beta tester and can't see Minimize as a suggestion in the Suggestion Bar after evaluation Interpolation.

POSTED BY: Martin Hadley
2 Replies
Making a plot of an interpolation also requires that you give a variable. Examples of this are given in the documentation:
f = Interpolation[{1, 2, 3, 5, 8, 5}]
Plot[f[x], {x, 1, 6}]

We can follow the same pattern with NMinmize. Because we are using an interpolation, I have included constraints for NMinimize to constrain it to the region of the iterpolation. In this case the interpolation is where the independant variable is between -1 and 1.
data={{-1., 0.175194}, {-0.9, -0.026003}, {-0.8, -0.0807706}, {-0.7, -0.142006}, {-0.6, -0.250069}, {-0.5, -0.262721}, {-0.4, -0.271475}, {-0.3, -0.196399}, {-0.2, -0.301731}, {-0.1, -0.0954844}, {5.55112*10^-17, -0.0656419}, {0.1, 0.0820605}, {0.2, 0.204884}, {0.3, 0.420364}, {0.4, 0.551297}, {0.5, 0.74569}, {0.6, 0.837153}, {0.7, 1.14175}, {0.8, 1.3972}, {0.9, 1.59105}, {1., 1.73636}};
f = Interpolation[data];
NMinimize[{f[x],-1<x<1}, x]

Minimizing an interpolation doesn't appear yet as a suggested operation. I am not sure however it is a common task. With real world data, you usually see optimization done on statistical models or something similar. It's important to remember that the minimum can depend heavily on the kind of interpolation that is used and for sufficiently smooth interpolations, it really just gives the rough location of the smallest element. If you would like to suggest improvements on the predictive interface, you can always do so by clicking orange speech bubble that appears to the right of the suggestion bar.
POSTED BY: Sean Clarke
Thanks for this explanation, Sean.

From your description of minimising an interpolation function I think what I was wanting to do should be solved in a different way...
POSTED BY: Martin Hadley
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract