public class StdCorrelationStatistic extends CorrelationStatistic implements BatchExportable
StdCorrelationStatistic
provides an implementation to
calculate the coefficient of correlation and the covariance between 2 series
of samples.
Following keywords are defined for printing the results:
Modifier and Type | Field and Description |
---|---|
protected Summation |
coeffMeasures |
protected Summation |
covarianceMeasures |
protected Summation |
xSampleSummation |
protected double |
xySampleSummation |
protected Summation |
ySampleSummation |
sampleIndex, simNode, traceWriter
Constructor and Description |
---|
StdCorrelationStatistic(java.lang.String name,
SimNode owner) |
Modifier and Type | Method and Description |
---|---|
void |
computeMeasures(int batchNumber) |
void |
exportBatch(ResultWriter writer)
Exports the batch state to a result writer.
|
double |
getCoefficient() |
double |
getCoefficientConfidenceInterval() |
double |
getCovariance() |
double |
getCovarianceConfidenceInterval() |
void |
importBatch(ResultReader reader)
Imports the state of a batch from the result reader.
|
void |
resetBatchStatistic()
only between batches
|
void |
resetStatistic()
reset complete statistic
|
void |
update(double xSample,
double ySample) |
getResultTypeName, printResults
addResultTag, addResultTag, disableTracing, enableTracing, handleInitSimulation, handleStartBatch, handleStartTransientPhase, handleStopBatch, handleStopTransientPhase, printComments, update, writeTraceEntry
protected double xySampleSummation
protected final Summation xSampleSummation
protected final Summation ySampleSummation
protected final Summation coeffMeasures
protected final Summation covarianceMeasures
public StdCorrelationStatistic(java.lang.String name, SimNode owner)
public void exportBatch(ResultWriter writer) throws ResultException
BatchExportable
importBatch
despite the keywords.exportBatch
in interface BatchExportable
writer
- the result writer which preserves the stateResultException
- if any exception occurs while writing a result to the writerpublic void importBatch(ResultReader reader) throws ResultException
BatchExportable
exportBatch
despite the keywords.importBatch
in interface BatchExportable
reader
- the result reader which contains the batch stateResultException
- if any exception occurs while reading a result from the readerpublic double getCoefficient()
getCoefficient
in class CorrelationStatistic
public double getCoefficientConfidenceInterval()
getCoefficientConfidenceInterval
in class CorrelationStatistic
public double getCovariance()
getCovariance
in class CorrelationStatistic
public double getCovarianceConfidenceInterval()
getCovarianceConfidenceInterval
in class CorrelationStatistic
public void update(double xSample, double ySample)
update
in class CorrelationStatistic
public void computeMeasures(int batchNumber)
computeMeasures
in class Statistic
public void resetBatchStatistic()
Statistic
resetBatchStatistic
in class Statistic
public void resetStatistic()
Statistic
resetStatistic
in class Statistic