public class AccumStat extends Unit
The unit outputs simultaneously (from an appropriate number of output nodes) a collection of data sets of the same type as the input, one for each desired statistic (eg, mean, variance, etc.) The output sets contain the statistics of each of the dependent data arrays of the input sets that are of arithmetic type. The statistics are computed element-by-element, so that the output arrays have the same dimensionality and size as the input arrays. Dependent data that are not arithmetic arrays (numbers) are passed directly through to the output.
The unit can produce mean, variance, skewness (as the third moment, not normalized by the variance), kurtosis (again not normalized), and higher moments up to order 8. Data are output in the order of the moment: node 0 = mean, node 1 = variance, node 2 = skew, node 3 = kurtosis, etc. Apart from the mean, the formula for the nth moment is < (data - mean)^n >, where <..> indicates an average over the accumulated sets. Note that the moments are not normalized by the variance, as is the case for the usual definition of skew and kurtosis.
The accumulation continues in either single-step or continuous mode, as long as the network of units is not reset. At the beginning of a sequence, before the number of input sets reaches the number given in the parameter window, the output after each computation is a correct average of the sets so far received. After the number of inputs has reached the desired number, then the average is made over the appropriate number of the most recent input sets. If the number of moments is increased during the computation then the output for the extra moments will not be exactly correct until the desired number of inputs has been reached.
The algorithms saves a rolling queue of input data sets with a length equal to the number being averaged, so if input sets are large or the number to be averaged is large then the memory storage requirements can grow rapidly. Users should exercise caution.
If the number of data sets to accumulate is changed in the parameter window during a sequence of computations, the unit will behave correctly, either accumulating more (if it is increased) or forgetting the earliest ones (if it is decreased). If the number of moments to be output is reset in the parameter window to a number that is more than the current number of output nodes, then the number of nodes is automatically increased. If number of nodes is larger than the number of moments to be output, then the extra nodes are used to duplicate output data, just as for simple units that produce only one output. Data are output to the excess nodes in a cyclic manner: eg if there are 2 moments and 4 nodes the data will be output as node0:mean, node1:variance, node2:mean, node3:variance. If the network is reset then the accumulated data will be lost and the averaging will start anew.
Modifier and Type | Field and Description |
---|---|
int |
highestPower
The highest power to be computed (1 is for computing the mean).
|
int |
oldHighestPower
The highest power that was computed for the previous data set.
|
CLONE_ALL_OUTPUT, CLONE_MULTIPLE_OUTPUT, COPY_OUTPUT, ESSENTIAL, ESSENTIAL_IF_CONNECTED, IMMEDIATE_UPDATE, INTERNAL, LATE_INITIALIZE, NO_UPDATE, ON_TASK_INSTANTATION, ON_USER_ACCESS, OPTIONAL, PROCESS_UPDATE, TRANSIENT, TRANSIENT_ACCESSIBLE, USER_ACCESSIBLE
Constructor and Description |
---|
AccumStat() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHelpFile() |
java.lang.String[] |
getInputTypes()
This method should return an array of the data types accepted by nodes not specified in getNodeInputTypes (e.g.
|
java.lang.String[] |
getOutputTypes()
This method should return an array of the data types output by nodes not specified in getNodeOutputTypes() (e.g.
|
java.lang.String |
getPopUpDescription()
This returns a brief! description of what the unit does.
|
void |
init()
Initialses information specific to AccumStat.
|
void |
parameterUpdate(java.lang.String name,
java.lang.Object value)
Loads AccumStat's parameters from the parameter file.
|
void |
process()
The main functionality of AccumStat goes here
|
void |
reset()
Resets AccumStat
|
void |
stopping()
Called when the stop button is pressed within the MainTriana Window
|
debug, debug, defineParameter, dispose, extractClipInState, getClipIn, getClipIn, getControlInterface, getDefaultInputNodes, getDefaultNodeRequirement, getDefaultOutputNodes, getDisplayName, getDisplayPackage, getGUIBuilderV2Info, getHelpFileLocation, getInputAtNode, getInputNodeCount, getMaximumInputNodes, getMaximumOutputNodes, getMinimumInputNodes, getMinimumOutputNodes, getNodeInputTypes, getNodeOutputTypes, getOutputNodeCount, getOutputPolicy, getPackageName, getParameter, getParameterPanelClass, getParameterPanelInstantiate, getParameterType, getParameterUpdatePolicy, getRunnableInterface, getTask, getTaskGraphContext, getToolName, getToolPackage, getToolTable, getVersion, hideParameterPanel, isClipInName, isInputAtNode, isOutputSent, isParameter, log, log, notifyError, notifyError, output, outputAtNode, outputAtNode, parameterUpdated, putClipIn, removeClipIn, removeParameter, restoreClipInState, setDefaultInputNodes, setDefaultNodeRequirement, setDefaultOutputNodes, setDisplayName, setDisplayPackage, setGUIBuilderV2Info, setHelpFileLocation, setMaximumInputNodes, setMaximumOutputNodes, setMinimumInputNodes, setMinimumOutputNodes, setOutputPolicy, setParameter, setParameterPanelClass, setParameterPanelInstantiate, setParameterUpdatePolicy, setPopUpDescription, setRunnableInterface, setToolName, setToolPackage, setVersion, showParameterPanel
public int highestPower
public int oldHighestPower
public java.lang.String getPopUpDescription()
getPopUpDescription
in class Unit
public void parameterUpdate(java.lang.String name, java.lang.Object value)
parameterUpdate
in class Unit
public java.lang.String[] getInputTypes()
Unit
getInputTypes
in class Unit
public java.lang.String[] getOutputTypes()
Unit
getOutputTypes
in class Unit
public java.lang.String getHelpFile()
public void stopping()