jsim.statistic
Class Statistic

java.lang.Object
  extended by jsim.statistic.Statistic
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
SampleStat, TimeStat

public abstract class Statistic
extends java.lang.Object
implements java.io.Serializable

This class provides facilities for gathering and displaying statistical summary results of simulation runs.

See Also:
Serialized Form

Field Summary
protected static double CONF_LEVEL
          Default confidence level (.95 or 95%)
static java.lang.String[] LABEL
          Standard label set for statistical results.
protected  double lastTime
          Time of last observation
protected static double MAX_DOUBLE
          Largest double value in Java
protected  double maxValue
          Maximum value of sample data
protected  double minValue
          Minimum value of sample data
protected static boolean MONITOR
          Flag indicating whether to monitor (print) values as they are collected
protected  java.lang.String name
          Name of the statistic being collected
protected  double nobs
          Number of observations
protected  boolean primary
          Whether this is the primary statistic for a model
protected  double sum
          Sum of sample data
protected  double sumSquares
          Sum of squares
protected  double sumSquBatch
          Sum of Square value between two consective observations collected for batch statistics
protected static java.util.logging.Logger trc
          Tracing messages
 
Constructor Summary
Statistic(java.lang.String name)
          Constructs a statistical object.
 
Method Summary
 double confidence()
          Return the confidence interval half-width for default confidence level.
 double confidence(double level)
          Return the confidence interval half-width for level (e.g., .95).
 java.lang.String getName()
          Get the name of this statistic.
 java.util.Vector getStats()
          Get statistical value vector for this stat variable.
 double getSumSquBatch()
          Return the sum of square value between the consective obs used for batch mean statistics.
 double max()
          This method returns the maximum value collected.
 double mean()
          This method returns the mean of the collected values.
 double min()
          This method returns the minimum value collected.
 double precision()
          Return the relative precision for the default confidence level.
 double precision(double level)
          Return the relative precision for the given confidence level.
static void printLabel()
          Print column labels.
 void printStat()
          Print statistical information.
 void resetStat(double time)
          Reset the statistical counter.
 double rms()
          This method returns root mean squares of collected data.
 int samples()
          Return the number of samples.
 void setPrimary(boolean value)
          Set the primary stat indicator.
 double stdDev()
          This method returns the standard deviation of the collected values.
 double variance()
          This method returns the variance of the collected values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DOUBLE

protected static final double MAX_DOUBLE
Largest double value in Java

See Also:
Constant Field Values

MONITOR

protected static final boolean MONITOR
Flag indicating whether to monitor (print) values as they are collected

See Also:
Constant Field Values

CONF_LEVEL

protected static final double CONF_LEVEL
Default confidence level (.95 or 95%)

See Also:
Constant Field Values

LABEL

public static final java.lang.String[] LABEL
Standard label set for statistical results.


name

protected final java.lang.String name
Name of the statistic being collected


trc

protected static java.util.logging.Logger trc
Tracing messages


primary

protected boolean primary
Whether this is the primary statistic for a model


nobs

protected double nobs
Number of observations


lastTime

protected double lastTime
Time of last observation


minValue

protected double minValue
Minimum value of sample data


maxValue

protected double maxValue
Maximum value of sample data


sum

protected double sum
Sum of sample data


sumSquares

protected double sumSquares
Sum of squares


sumSquBatch

protected double sumSquBatch
Sum of Square value between two consective observations collected for batch statistics

Constructor Detail

Statistic

public Statistic(java.lang.String name)
Constructs a statistical object.

Parameters:
name - name of statistic
Method Detail

setPrimary

public void setPrimary(boolean value)
Set the primary stat indicator.

Parameters:
value - whether its primary

min

public double min()
This method returns the minimum value collected.

Returns:
double the minimum value

max

public double max()
This method returns the maximum value collected.

Returns:
double the maximum value

mean

public double mean()
This method returns the mean of the collected values.

Returns:
double the mean value

variance

public double variance()
This method returns the variance of the collected values.

Returns:
double the variance

stdDev

public double stdDev()
This method returns the standard deviation of the collected values.

Returns:
double the standard deviation

rms

public double rms()
This method returns root mean squares of collected data.

Returns:
double root mean squares

samples

public int samples()
Return the number of samples.

Returns:
int number of samples

confidence

public double confidence(double level)
Return the confidence interval half-width for level (e.g., .95).

Parameters:
level - confidence level
Returns:
double confidence interval half-width

confidence

public double confidence()
Return the confidence interval half-width for default confidence level.

Returns:
double confidence interval half-width

precision

public double precision(double level)
Return the relative precision for the given confidence level.

Parameters:
level - confidence level
Returns:
double relative precision

precision

public double precision()
Return the relative precision for the default confidence level.

Returns:
double relative precision

resetStat

public void resetStat(double time)
Reset the statistical counter.

Parameters:
time - time of reset

getSumSquBatch

public double getSumSquBatch()
Return the sum of square value between the consective obs used for batch mean statistics.

Returns:
double sum of square of batch means

getStats

public java.util.Vector getStats()
Get statistical value vector for this stat variable.

Returns:
Vector vector of value for this statistic

printLabel

public static void printLabel()
Print column labels.


printStat

public void printStat()
Print statistical information.


getName

public java.lang.String getName()
Get the name of this statistic.

Returns:
String the name of this statistic