|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectetomica.data.DataProcessor
etomica.data.DataProcessorForked
etomica.data.DataAccumulator
etomica.data.AccumulatorAverageCollapsingLog
public class AccumulatorAverageCollapsingLog
AccumulatorAverage that keeps track of block averages and standard deviations corresponding to all block sizes from 1 to the n where n is the largest power of 2 less than the current number of samples. In addition to block averages and standard deviations of the sampled quantity, the natural log of the block averages and standard deviation of the natural log is also calculated (this is what makes this class actually useful). getData returns the average natural log values for all block sizes as a DataFunction.
This class also uses a method to improve the block statistics for large. All block averages are kept for a particular block size (n1 blocks of size b1). Statistics for that block are computed from that data. Block averages for blocks of the next larger size (2*n1) are computed by randomly selecting n1/2 pairs of block values from the b1 set (without including any block value more than once). After using all block values, n1/2 additional pairs are taken from the full b1 set, such that n1 blocks of size b1*2 are obtained, instead of n1/2 blocks that would normally exist. Statistics for block size b1*2 are computed from these n1 blocks. This process is repeated for each block size such that the largest block size (which would normally have 1 block) has n1 blocks.
This accumulator can only operate on Data with a single value.
| Field Summary | |
|---|---|
protected DataFunction |
averages
|
protected DataFunction.DataInfoFunction |
avgDataInfo
|
protected double[] |
blockSums
|
protected long |
count
|
protected ArrayList<Integer> |
intArrayList
|
protected double[][] |
lSums
|
protected DataDoubleArray |
nData
|
protected DataDoubleArray.DataInfoDoubleArray |
nDataInfo
|
protected int |
nRawData
|
protected int |
nRawDataDoubles
|
protected DataTag |
nTag
|
protected IRandom |
random
|
protected double[] |
rawData
|
protected double[] |
rawData2
|
protected double[] |
rawData3
|
protected int |
rawDataBlockSize
|
protected DataFunction |
stdev
|
protected double[][] |
sums
|
| Fields inherited from class etomica.data.DataAccumulator |
|---|
active, putCount |
| Fields inherited from class etomica.data.DataProcessor |
|---|
dataInfo, dataSink, tag, trueDataSink |
| Constructor Summary | |
|---|---|
AccumulatorAverageCollapsingLog(IRandom random)
|
|
| Method Summary | |
|---|---|
void |
addData(IData data)
Add the given values to the sums and block sums. |
protected void |
doSums(double[] subSums,
double v)
Performs the block sum after |
protected void |
ensureHappyIntArrayList()
Refills inArrayList if it's empty. |
IData |
getAverageLogs()
Returns the average natural logs of the block averages, for all block sizes. |
IData |
getAverages()
Returns the averages for all block sizes |
IData |
getData()
Returns the Data generated by accumulating the Data previously given to this instance. |
DataPipe |
getDataCaster(IEtomicaDataInfo incomingDataInfo)
Checks that incoming Data implements Data, and returns null if this is so. |
int |
getIndependentArrayDimension()
Returns the number of independent data dimensions |
DataDoubleArray |
getIndependentData(int i)
Returns the X data for the given dimension |
DataDoubleArray.DataInfoDoubleArray |
getIndependentDataInfo(int i)
Returns the DataInfo for the given dimension |
DataTag |
getIndependentTag()
Returns the tag associated with this DataSource. |
IData |
getStdev()
Returns the standard deviation of the block averages, for all block sizes. |
IData |
getStdevLog()
Returns the standard deviation of the log of the block averages, for all block sizes. |
static void |
main(String[] args)
|
IData |
processData(IData inputData)
Implementation of DataProcessor interface. |
IEtomicaDataInfo |
processDataInfo(IEtomicaDataInfo incomingDataInfo)
Informs this DataProcessor of the DataInfo for the Data it will be processing. |
protected void |
reblockData()
Reblock data from rawData2 into rawData3, then copy it back to rawData2 |
void |
reset()
Resets all sums to zero. |
protected void |
resizeData(int newSize)
|
void |
setNumRawDataDoubles(int newNumRawDataDoubles)
Sets the number of times the random block generation method is used. |
| Methods inherited from class etomica.data.DataAccumulator |
|---|
getPushInterval, isActive, setActive, setPushInterval, toString |
| Methods inherited from class etomica.data.DataProcessorForked |
|---|
addDataSink, getDataSink, getDataSinks, removeDataSink, setDataSink, setDataSinks |
| Methods inherited from class etomica.data.DataProcessor |
|---|
getDataInfo, getTag, insertTransformerIfNeeded, putData, putDataInfo |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface etomica.data.IEtomicaDataSource |
|---|
getDataInfo, getTag |
| Methods inherited from interface etomica.data.DataPipe |
|---|
getTag |
| Methods inherited from interface etomica.data.IDataSink |
|---|
putData, putDataInfo |
| Field Detail |
|---|
protected long count
protected double[] blockSums
protected double[][] sums
protected double[][] lSums
protected DataFunction averages
protected DataFunction stdev
protected DataFunction.DataInfoFunction avgDataInfo
protected DataDoubleArray.DataInfoDoubleArray nDataInfo
protected DataDoubleArray nData
protected final DataTag nTag
protected double[] rawData
protected double[] rawData2
protected double[] rawData3
protected int nRawData
protected int rawDataBlockSize
protected int nRawDataDoubles
protected ArrayList<Integer> intArrayList
protected final IRandom random
| Constructor Detail |
|---|
public AccumulatorAverageCollapsingLog(IRandom random)
| Method Detail |
|---|
public void setNumRawDataDoubles(int newNumRawDataDoubles)
public DataPipe getDataCaster(IEtomicaDataInfo incomingDataInfo)
getDataCaster in interface IDataSinkincomingDataInfo - the DataInfo for the Data that will fed to the sink's putData methodpublic IData processData(IData inputData)
DataAccumulator
processData in class DataAccumulatorinputData - the Data for processing
public void addData(IData data)
addData in class DataAccumulatorprotected void resizeData(int newSize)
public IData getData()
DataAccumulator
getData in interface IDataSourcegetData in class DataAccumulatorpublic IData getAverages()
public IData getAverageLogs()
protected void reblockData()
protected void ensureHappyIntArrayList()
public IData getStdev()
public IData getStdevLog()
protected void doSums(double[] subSums,
double v)
public void reset()
reset in class DataAccumulatorpublic IEtomicaDataInfo processDataInfo(IEtomicaDataInfo incomingDataInfo)
DataProcessor
processDataInfo in class DataProcessorpublic int getIndependentArrayDimension()
DataSourceIndependent
getIndependentArrayDimension in interface DataSourceIndependentpublic DataDoubleArray getIndependentData(int i)
DataSourceIndependent
getIndependentData in interface DataSourceIndependentpublic DataDoubleArray.DataInfoDoubleArray getIndependentDataInfo(int i)
DataSourceIndependent
getIndependentDataInfo in interface DataSourceIndependentpublic DataTag getIndependentTag()
DataSourceIndependent
getIndependentTag in interface DataSourceIndependentpublic static void main(String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||