{"id":67,"date":"2007-07-26T16:20:16","date_gmt":"2007-07-26T14:20:16","guid":{"rendered":"http:\/\/www.hermione.de\/blog\/?p=67"},"modified":"2008-06-05T17:29:19","modified_gmt":"2008-06-05T15:29:19","slug":"rrdtools-least-square-lines","status":"publish","type":"post","link":"http:\/\/blog.hermione.de\/?p=67","title":{"rendered":"RRDTools &#8211; Least Square Lines"},"content":{"rendered":"<h4>Least Square Lines with LSLSLOPE, LSLINT<\/h4>\n<p>LSLSLOPE and LSLINT return the parameters for a Least Squares Line (y = mx +b) which approximate the provided dataset. LSLSLOPE is the slope (m) of the line related to the COUNT position of the data. LSLINT is the y-intercept (b), which happens also to be the first data point on the graph.<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/dadidi.ath.cx\/baru\/baruLSL.png\" \/><\/p>\n<p><!--more--><br \/>\n<em> rrdtool graph baruLSL.png \\<br \/>\n&#8211;title &#8222;Baru Counter&#8220; \\<br \/>\n&#8211;vertical-label Barus \\<br \/>\n&#8211;start 1181500000 \\<br \/>\n&#8211;end 1182800000 \\<br \/>\n&#8211;x-grid HOUR:12:DAY:1:DAY:7:0:%Y-%m-%d \\<br \/>\nDEF:baru=baru00.rrd:baru:AVERAGE \\<br \/>\nAREA:baru#ddffdd \\<br \/>\nLINE1:baru#00cc00 \\<br \/>\n<strong>VDEF:slm=baru,LSLSLOPE \\<br \/>\nVDEF:slb=baru,LSLINT \\<br \/>\nCDEF:ls=baru,COUNT,EXC,POP,slm,*,slb,+ \\<br \/>\nLINE1:ls#333333:LSL000 \\<\/strong><br \/>\nCOMMENT:&#8220;y =&#8220; \\<br \/>\nGPRINT:&#8220;slm:%4.4lf&#8220; \\<br \/>\nCOMMENT:&#8220;*x +&#8220; \\<br \/>\nGPRINT:&#8220;slb:%4.0lf\\n&#8220; \\<br \/>\nDEF:baru100=baru00.rrd:baru:AVERAGE:end=start+100h \\<br \/>\nVDEF:slm100=baru100,LSLSLOPE \\<br \/>\nVDEF:slb100=baru100,LSLINT \\<br \/>\nCDEF:ls100=baru100,COUNT,EXC,POP,slm100,*,slb100,+ \\<br \/>\nLINE1:ls100#cc00cc:LSL100 \\<br \/>\nCOMMENT:&#8220;y =&#8220; \\<br \/>\nGPRINT:&#8220;slm100:%4.4lf&#8220; \\<br \/>\nCOMMENT:&#8220;*x +&#8220; \\<br \/>\nGPRINT:&#8220;slb100:%4.0lf\\n&#8220; \\<br \/>\n<strong>CDEF:cr2500=baru,COUNT,EXC,POP,slm,*,slb,+,2500,LT,TIME,0,IF \\<br \/>\nVDEF:crp2500=cr2500,MAXIMUM \\ <\/strong><br \/>\nCDEF:cr5000=ls,5000,LT,TIME,0,IF \\<br \/>\nVDEF:crp5000=cr5000,MAXIMUM \\<br \/>\nCOMMENT:&#8220;Crossing 2500 &#8220; \\<br \/>\nGPRINT:&#8220;crp2500:%12.0lf\\n&#8220;\\<br \/>\nCOMMENT:&#8220;Crossing 5000 &#8220; \\<br \/>\nGPRINT:&#8220;crp5000:%12.0lf\\n&#8220;<br \/>\n<\/em><\/p>\n<p><strong>COUNT<\/strong> pushes the number 1 if this is the first value of the data set, the number 2 if it is the second, and so on. This special value allows you to make calculations based on the position of the value within the data set.<br \/>\n<strong>POP<\/strong> removes the top element of the stack.<br \/>\n<strong>EXC<\/strong> exchanges the two top elements.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Least Square Lines with LSLSLOPE, LSLINT LSLSLOPE and LSLINT return the parameters for a Least Squares Line (y = mx +b) which approximate the provided dataset. LSLSLOPE is the slope (m) of the line related to the COUNT position of the data. LSLINT is the y-intercept (b), which happens also to be the first data [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[],"_links":{"self":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/67"}],"collection":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=67"}],"version-history":[{"count":0,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=\/wp\/v2\/posts\/67\/revisions"}],"wp:attachment":[{"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=67"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=67"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/blog.hermione.de\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=67"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}