<!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>
--start=-7days --end=+3days --width=1000 --height=200
--alt-autoscale-max \<br>
DEF:value=value.rrd:value:AVERAGE:start=-14days \<br>
LINE1:value#ff0000:value \<br>
CDEF:predict=86400,-7,1800,value,PREDICT \<br>
CDEF:sigma=86400,-7,1800,value,PREDICTSIGMA \<br>
CDEF:upper=predict,sigma,3,*,+ \<br>
CDEF:lower=predict,sigma,3,*,- \<br>
LINE1:predict#00ff00:prediction \<br>
LINE1:upper#0000ff:upper\ certainty\ limit \<br>
LINE1:lower#0000ff:lower\ certainty\ limit \<br>
CDEF:exceeds=value,UN,0,value,lower,upper,LIMIT,UN,IF \<br>
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>
Martin<br>
</body>
</html>