Hi there,

Still mumbling about interpolation options ...

IMO, many options may decrease clarity.
As far the options are sufficient to the pursued function, I prefer to stay low with options.

I think that the most usual implementation of rounding is
is half-up-simmetric, also known as half-away-from-zero:

 0.5  -->  1.0
 1.5  -->  2.0
-0.5  --> -1.0

At least, this is what ISO/IEC 9899 states for the C math library.

Note that, because DAVE-ML asks for monotonically increasing breakpoints, "up" refers both to position and value. It's a little precisation but may be useful for clarity (after all
free us from the simmetry problem).

Round the half point to the nearest even (or odd) integer is the IEEE 754 (aka Banker's):

 0.5  -->  0.0
 1.5  -->  2.0

This is because rounding always up may bias the results, an issue
in statistical applications or when lot of values are added.
But, as Randy says, it's hard to see how we can use it here,
as for the even test we have to consider not the values but the
positions of the breakpoints, and this seems not very intuitive.

So, I suggest half-up for the nearest option of the discrete interpolation method.

IMO two options (floor and nearest) are more than sufficient.
In the other cases, I think that is fair to ask the modeller to redefine the function (by rearranging the whole table, that includes both values and breakpoint set, as Dan highlighted).

I bet nobody will need an half-even nearest, but an half-down nearest may be a possible request and a ceil is probable.
Because ceil is probable (but my personal feeling is that is not
very intuitive), and because breakpoint set may be shared by different
tables I agree that the three options (ceil, floor and nearest) may be a more friendly choice.

Last few points, and maybe more interesting than my above chatter :)

The current documentation does not define which is the default when the value for interpolation is not specified. I suppose linear interpolation is the default.

When extrapolation is admitted for one or both sides (default is ...)
what method is used? The same for interpolation seems intuitive. In this case how do behave discrete methods? Ceil for min and floor for max (or nearest wrt +/-infinite).

Being the interpolation method associated to the independent variables, when functions have more than one independent variable, it is possible to specify different methods? Is it common/useful?


Reply via email to