CDL - STATS: Difference between revisions

From Cumulus Wiki
Jump to navigationJump to search
Line 7: Line 7:
== Statistical functions ==
== Statistical functions ==
The STATS keyword requires a ''Plotvariable'' on which to apply the statistics and a method to apply and a statistical method to use.
The STATS keyword requires a ''Plotvariable'' on which to apply the statistics and a method to apply and a statistical method to use.
     STATS <[[Charts_Definition_Language_(CDL)#Plotvariables|Plotvariable]]> <Statistical method>
     STATS [ALL||DAILY|RECENT|EXTRA] <[[Charts_Definition_Language_(CDL)#Plotvariables|Plotvariable]]> <Statistical method>


The following statistical methods are available in the ChartsCompiler:
The following statistical methods are available in the ChartsCompiler:
Line 22: Line 22:


   CHART DailyRain TITLE Rain with statistics
   CHART DailyRain TITLE Rain with statistics
     PLOT ALL RainFall colour CornflowerBlue as column  
     PLOT ALL DayRain colour CornflowerBlue as column  
     PLOT ALL RainFall EVAL [ SUM( RainFall ) ] COLOUR crimson AXIS Free
     PLOT ALL SumDayRain EVAL [ SUM( DayRain ) ] COLOUR crimson AXIS Free
     STATS RainFall SMA colour green
     STATS ALL DayRain SMA colour green
   EndChart OUTPUT Statistics.txt
   EndChart
 


[[Category:CumulusUtils]]
[[Category:CumulusUtils]]

Revision as of 08:04, 3 July 2022

Introduction

The STATS plots a statistic of a specific Plotvariable in the chart. The normal PLOT of that variable must be present. STATS implies the ALL or DAILY range specification. RECENT PLOTS have no STATS defined (at the moment).

A STATistic is by definition a derivative of a series of a Plotvariable e.g. the Standard deviation or a running average. A Mean in itself is a single value and single value statistics are not plottable as such. They are usually reported in other ways. To be able to use the STATS for a certain Plotvariable the statistic needs to be made available in the runtime of the compiler. Technically it might be possible to supply statistics through the EVAL functionality and in some cases that might work. In general that technique is disadvised.

Statistical functions

The STATS keyword requires a Plotvariable on which to apply the statistics and a method to apply and a statistical method to use.

   STATS [ALL||DAILY|RECENT|EXTRA] <Plotvariable> <Statistical method>

The following statistical methods are available in the ChartsCompiler:

  1. SMA - Best explained in the external Wiki: Simple Moving Average

-- To be Expanded --

Examples

Schermafbeelding 2021-05-21 154949.jpg

The following example shows the Rain for all days (all observations). In addition the yearly cumulative curve is shown and the moving average (SMA - Simple Moving Average). See image on the right. The period for the Moving Average is given by the user as value to the parameter : PeriodMovingAverage= <value> (section [graphs]

 CHART DailyRain TITLE Rain with statistics
   PLOT ALL DayRain colour CornflowerBlue as column 
   PLOT ALL SumDayRain EVAL [ SUM( DayRain ) ] COLOUR crimson AXIS Free
   STATS ALL DayRain SMA colour green
 EndChart