etomica.data
Class AccumulatorAverage
java.lang.Object
etomica.data.DataProcessor
etomica.data.DataProcessorForked
etomica.data.DataAccumulator
etomica.data.AccumulatorAverage
- All Implemented Interfaces:
- DataPipe, DataPipeForked, IDataSink, IDataSource, IEtomicaDataSource, Serializable
- Direct Known Subclasses:
- AccumulatorAverageCollapsing, AccumulatorAverageFixed, AccumulatorAverageFixedOutputFile
public abstract class AccumulatorAverage
- extends DataAccumulator
Accumulator that keeps statistics for averaging and error analysis. The
statisics are incremented with every call to addData. Statistics kept are
- the value last given to addData
- the mean, or average
- the statistical error (67% confidence limits), obtained by standard
error analysis of block averages
- the standard deviation
- the most recent block average
Each statistic is recorded by a Data instance of the same type as the
incoming data. The output Data is a DataGroup formed from these Data
instances (in the order given above).
A block is a subset of the input data, formed by grouping (for
example) 100 or 1000 successive contributions to addData. Averages for each
block are considered to be independent of other block averages, and the
confidence limits for the overall average is obtained as the standard error
of the mean of these block averages.
- See Also:
- Serialized Form
|
Nested Class Summary |
static class |
AccumulatorAverage.StatType
Enumerated type that can be used to indicated the statistic to be taken
from the accumulator (e.g., average, error, current value, etc.). |
|
Constructor Summary |
AccumulatorAverage()
Default constructor sets block size to Default value, and sets the
interval for pushing the output data (pushInterval) to 100. |
AccumulatorAverage(long blockSize)
|
mostRecent
protected IData mostRecent
average
protected IData average
error
protected IData error
standardDeviation
protected IData standardDeviation
blockCorrelation
protected IData blockCorrelation
dataGroup
protected DataGroup dataGroup
count
protected long count
blockCountDown
protected long blockCountDown
blockSize
protected long blockSize
AccumulatorAverage
public AccumulatorAverage()
- Default constructor sets block size to Default value, and sets the
interval for pushing the output data (pushInterval) to 100.
AccumulatorAverage
public AccumulatorAverage(long blockSize)
getTag
public DataTag getTag(AccumulatorAverage.StatType statType)
reset
public void reset()
- Resets all sums to zero. All statistics are cleared.
- Specified by:
reset in class DataAccumulator
setBlockSize
public void setBlockSize(long newBlockSize)
- Sets the size of the block used to group data for error analysis. Resets
statistics accumulated so far. Default is 1000.
- Parameters:
blockSize - new block size.
getBlockSize
public long getBlockSize()
- Returns the current value of the block size.
processDataInfo
public IEtomicaDataInfo processDataInfo(IEtomicaDataInfo incomingDataInfo)
- Prepares the accumulator for input data. Discards any previous
contributions to statistics.
- Specified by:
processDataInfo in class DataProcessor
- Parameters:
incomingDataInfo - the DataInfo instance for the data that will be given to
addData
- Returns:
- the DataInfo of the Data that will be output by this
DataProcessor
addDataSink
public void addDataSink(IDataSink newDataSink,
AccumulatorAverage.StatType[] types)
- Adds a new DataSink that will receive a specific subset of the statistics
generated by this accumulator. The DataSink will be given a DataGroup
that has only the specified statistics in it. The output of this
accumulator is passed through a DataGroupFilter that removes the unwanted
Data.
- Parameters:
newDataSink - the new DataSinktypes - array indicating the statistics to be included in the
DataGroup sent to the sink.
getBlockCount
public long getBlockCount()
- Returns the number of blocks that have been accumulated since construction or
the last call to reset.