Average

Module used to calculate the average of its input over time. There are three different types of average that can be calculated: Cumulative moving average (CMA) which is the default; Simple moving average (SMA) over a window set by window_size; and exponentially moving average (EMA) with a weight set by alpha.

Example XML definition

A simple example

  <module
      class = "Average"
      name = "Average"
  />

Parameters

NameDescriptionTypeDefault
classThe class name for the module; must be "Average".string
nameThe name of this instance of the module.string
typethe type of averagechoices:
SMA
CMA
EMA
SMA
window_sizethe window size for SMAint100
alphathe weight for the new value for EMAfloat0.1
termination_criterionif the absolute average set by select is below this value the module will terminate execution of Ikarosfloat0
selectwhich value to use for the termination criteriaint0

Module Connections

Inputs

NameDescription
INPUTThe input

Outputs

NameDescription
OUTPUTThe output

Limitations

If run for very long numerical problems are likely to occur when the number of ticks or the sum of all inputs becomes too large.

Author

Christian Balkenius
christian.balkenius@lucs.lu.se
Lund University Cognitive Science

Files

Average.h
Average.cc
Average.ikc

blog comments powered by Disqus