oetiker/rrdtool-1.x — pull request #465 by msperl (2014-05-06 20:30:56+00:00)
Title: added PREDICTPERC(entil) CDEF function

there is one still open question: should we interpolate to get the final value?
Say: if we have 8 values, and we want thd 95th percventile, then
we should actually take the 6.65th 0-based index value (=95/100*(8-1)).
with the current implementation we round, so we return actually the 100th percentile.
what we could also do is:
value=val[floor(idx)]+(idx-floor(idx))*(val[floor(idx)+1]-val[floor(idx)])
(besides some boundry checking for the explicit percentile 100)

we could also allow the user to decide between the 2 options by setting the requested percentile to - to signify one of those options.

IMO interpolation makes more sense for any data is looked at over longer periods (say 1 year) where we have lower number of data-points due to the configured consolidation function...

This should get decided prior to final merging, as then we are essentially set in stone.

Martin

P.s: here an image for visualization of the predict options:
![test](https://cloud.githubusercontent.com/assets/2638784/2895221/394ffdde-d55d-11e3-93a6-1f2742a732e3.png)