DataPipe
, DataPipeForked
, IDataSink
, IDataSource
AccumulatorAverageCollapsing
, AccumulatorAverageFixed
, AccumulatorAverageFixedOutputFile
public abstract class AccumulatorAverage extends DataAccumulator
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 interval for the overall average is obtained as the standard error of the mean of these block averages.
Modifier and Type | Class | Description |
---|---|---|
static class |
AccumulatorAverage.StatType |
Enumerated type that can be used to indicate the statistic to be taken
from the accumulator (e.g., average, error, current value, etc.).
|
Modifier and Type | Field | Description |
---|---|---|
protected IData |
average |
|
static AccumulatorAverage.StatType |
AVERAGE |
|
static AccumulatorAverage.StatType |
BLOCK_CORRELATION |
|
protected IData |
blockCorrelation |
|
protected long |
blockCountDown |
|
protected long |
blockSize |
|
protected long |
count |
|
protected DataGroup |
dataGroup |
|
protected boolean |
doIncludeACInError |
|
protected IData |
error |
|
static AccumulatorAverage.StatType |
ERROR |
|
static AccumulatorAverage.StatType |
MOST_RECENT |
|
protected IData |
mostRecent |
|
static AccumulatorAverage.StatType |
STANDARD_DEVIATION |
|
protected IData |
standardDeviation |
active, hasUnpushedData, pushInterval, putCount
dataInfo, dataSink, tag
Constructor | Description |
---|---|
AccumulatorAverage() |
Default constructor sets block size to 1000 and sets the
interval for pushing the output data (pushInterval) to 100.
|
AccumulatorAverage(long blockSize) |
Constructs with interval for pushing the output data set to 100.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addDataSink(IDataSink newDataSink,
AccumulatorAverage.StatType[] types) |
Adds a new DataSink that will receive a specific subset of the statistics
generated by this accumulator.
|
boolean |
doIncludeACInError() |
|
long |
getBlockCount() |
|
long |
getBlockSize() |
|
IData |
getData(AccumulatorAverage.StatType stat) |
Returns a specific element from the DataGroup returned
by getData().
|
long |
getSampleCount() |
|
DataTag |
getTag(AccumulatorAverage.StatType statType) |
|
IDataInfo |
processDataInfo(IDataInfo incomingDataInfo) |
Prepares the accumulator for input data.
|
void |
reset() |
Resets all sums to zero.
|
void |
setBlockSize(long newBlockSize) |
Sets the size of the block used to group data for error analysis.
|
void |
setIncludeACInError(boolean newDoIncludeACInError) |
Include correction to the uncertainty from block correlation function as
prescribed in
Kolafa, Jiri(1986) 'Autocorrelations and subseries averages in Monte
Carlo Simulations', Molecular Physics (59) 1035
|
static AccumulatorAverage.StatType[] |
statChoices() |
addData, getData, getPushInterval, isActive, processData, setActive, setPushInterval, toString
getDataInfo, getTag, putData, putDataInfo
addDataSink, getDataSink, getDataSinks, removeDataSink, setDataSink, setDataSinks
putData, putDataInfo
getDataInfo, getTag
public static final AccumulatorAverage.StatType MOST_RECENT
public static final AccumulatorAverage.StatType AVERAGE
public static final AccumulatorAverage.StatType ERROR
public static final AccumulatorAverage.StatType STANDARD_DEVIATION
public static final AccumulatorAverage.StatType BLOCK_CORRELATION
protected IData mostRecent
protected IData average
protected IData error
protected IData standardDeviation
protected IData blockCorrelation
protected DataGroup dataGroup
protected long count
protected long blockCountDown
protected long blockSize
protected boolean doIncludeACInError
public AccumulatorAverage()
public AccumulatorAverage(long blockSize)
blockSize
- size of the block.public static AccumulatorAverage.StatType[] statChoices()
public DataTag getTag(AccumulatorAverage.StatType statType)
statType
- the statistic for which the DataTag is requested.public IData getData(AccumulatorAverage.StatType stat)
public void reset()
reset
in class DataAccumulator
public long getBlockSize()
public void setBlockSize(long newBlockSize)
newBlockSize
- new block size.public IDataInfo processDataInfo(IDataInfo incomingDataInfo)
processDataInfo
in class DataProcessor
incomingDataInfo
- the DataInfo instance for the data that will be given to
addDatapublic void addDataSink(IDataSink newDataSink, AccumulatorAverage.StatType[] types)
newDataSink
- the new DataSinktypes
- array indicating the statistics to be included in the
DataGroup sent to the sink.public long getBlockCount()
public long getSampleCount()
public boolean doIncludeACInError()
setIncludeACInError(boolean)
public void setIncludeACInError(boolean newDoIncludeACInError)
newDoIncludeACInError
- auto-correlation is accounted if true, otherwise it is not.