<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi!<br>
<br>
As promised in my libDBI Patch announcement a few days ago, I have now
created a patch with 2 new CDEFS that allow for some
prediction/extrapolation of values into the future by calculating
averages of values from the previous days/weeks.<br>
<br>
Here an example image of a series with the "prediction" and its
uncertainty borders:<br>
<img alt="example image for prediction"
 src="cid:part1.03030905.03040202@martin.sperl.org" height="263"
 width="1081"><br>
<br>
The graph creation is achieved with:<br>
rrdtool graph image.png --imgformat=PNG \<br>
&nbsp;--start=-7days --end=+3days --width=1000 --height=200
--alt-autoscale-max \<br>
&nbsp;DEF:value=value.rrd:value:AVERAGE:start=-14days \<br>
&nbsp;LINE1:value#ff0000:value \<br>
&nbsp;CDEF:predict=86400,-7,1800,value,PREDICT \<br>
&nbsp;CDEF:sigma=86400,-7,1800,value,PREDICTSIGMA \<br>
&nbsp;CDEF:upper=predict,sigma,3,*,+ \<br>
&nbsp;CDEF:lower=predict,sigma,3,*,- \<br>
&nbsp;LINE1:predict#00ff00:prediction \<br>
&nbsp;LINE1:upper#0000ff:upper\ certainty\ limit \<br>
&nbsp;LINE1:lower#0000ff:lower\ certainty\ limit \<br>
&nbsp;CDEF:exceeds=value,UN,0,value,lower,upper,LIMIT,UN,IF \<br>
&nbsp;TICK:exceeds#aa000080:1<br>
<br>
The prediction is only valid for a few days into the future.<br>
For longer term predictions another patch with a set of VDEFS/CDEFS is
planned that will use least square fitting of polynomials plus sums of
sinuses to get a reasonable prediction for time periods of 3 to 6 month
into the future. This will be based on some code that was written for
my astronomy thesis several years ago...<br>
<br>
Attached the patch, which only touches: src/rrd_rpncalc.h
src/rrd_rpncalc.c doc/rrdgraph_rpn.pod<br>
It also contains the documentation for the 2 new CDEFS in rrdgraph_rpn
- so in case of questions regarding usage, please read the
documentation in the patch. <br>
<br>
Please review and give feedback, so that it may get included into one
of the next releases of rrdtool.<br>
<br>
Thanks,<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; Martin<br>
</body>
</html>