Hi all,
I have created a simple Interpolation[] function and I would like to ask if it is possible to set some extrapolation method.
Thank you
Paolo
You could try to create (from your data) the next models:
LinearModelFit
NonlinearModelFit
etc.,
they are suitable for extrapolation.
But it’s better if you post your code and sample data, then we can find a solution.
You can set an arbitrary function to handle extrapolation:
ifn = Interpolation[Range[10]^2,
"ExtrapolationHandler" -> {
Piecewise[{{100 - (# - 10)^2, x >= 10}}, 1 + 10 (1 - #)] &,
"WarningMessage" -> False
}]
If you want extrapolation to be undefined, do something like this:
ifn = Interpolation[Range[10]^2,
"ExtrapolationHandler" -> {
Indeterminate &,
"WarningMessage" -> False
}]
Of course, Denis’s suggestions are better if you have a model for your data.