|
SSJ V. 2.0. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectumontreal.iro.lecuyer.stat.StatProbe
umontreal.iro.lecuyer.stat.Tally
public class Tally
This type of statistical collector takes a sequence of real-valued
observations and can return the average,
the variance, a confidence interval for the theoretical mean, etc.
Each call to add provides a new observation.
When the broadcasting to observers is activated,
the method add will also pass this new information to its
registered observers.
This type of collector does not memorize the individual observations,
but only their number, sum, sum of squares, maximum, and minimum.
The subclass TallyStore offers a collector that memorizes
the observations.
| Constructor Summary | |
|---|---|
Tally()
Constructs a new unnamed Tally statistical probe. |
|
Tally(String name)
Constructs a new Tally statistical probe with name name. |
|
| Method Summary | |
|---|---|
void |
add(double x)
Gives a new observation x to the statistical collector. |
double |
average()
Returns the average for this collector. |
Tally |
clone()
Clones this object. |
void |
confidenceIntervalNormal(double level,
double[] centerAndRadius)
Returns, in elements 0 and 1 of the array object centerAndRadius[], the center and half-length (radius) of a confidence interval on the true mean of the random variable X, with confidence level level, assuming that the n observations given to this collector are independent and identically distributed (i.i.d.) copies of X, and that n is large enough for the central limit theorem to hold. |
void |
confidenceIntervalStudent(double level,
double[] centerAndRadius)
Returns, in elements 0 and 1 of the array object centerAndRadius[], the center and half-length (radius) of a confidence interval on the true mean of the random variable X, with confidence level level, assuming that the observations given to this collector are independent and identically distributed (i.i.d.) copies of X, and that X has the normal distribution. |
void |
confidenceIntervalVarianceChi2(double level,
double[] interval)
Returns, in elements 0 and 1 of array interval, the left and right boundaries [I1, I2] of a confidence interval on the true variance σ2 of the random variable X, with confidence level level, assuming that the observations given to this collector are independent and identically distributed (i.i.d.) copies of X, and that X has the normal distribution. |
String |
formatCINormal(double level)
Equivalent to formatCINormal (level, 3). |
String |
formatCINormal(double level,
int d)
. |
String |
formatCIStudent(double level)
Equivalent to formatCIStudent (level, 3). |
String |
formatCIStudent(double level,
int d)
. |
String |
formatCIVarianceChi2(double level,
int d)
. |
String |
formatConfidenceIntervalNormal(double level)
Deprecated. |
String |
formatConfidenceIntervalNormal(double level,
int d)
|
String |
formatConfidenceIntervalStudent(double level)
Deprecated. |
String |
formatConfidenceIntervalStudent(double level,
int d)
|
double |
getConfidenceLevel()
Returns the level of confidence for the intervals on the mean displayed in reports. |
void |
init()
Initializes the statistical collector. |
int |
numberObs()
Returns the number of observations given to this probe since its last initialization. |
String |
report()
Returns a formatted string that contains a report on this probe. |
String |
report(double level,
int d)
Returns a formatted string that contains a report on this probe with a confidence interval level level using d fractional decimal digits. |
String |
reportAndCIStudent(double level)
Same as reportAndCIStudent
(level, 3). |
String |
reportAndCIStudent(double level,
int d)
Returns a formatted string that contains a report on this probe (as in report), followed by a confidence interval (as in
formatCIStudent), using d fractional decimal digits. |
String |
reportAndConfidenceIntervalStudent(double level)
Deprecated. |
String |
reportAndConfidenceIntervalStudent(double level,
int d)
|
void |
setConfidenceIntervalNone()
Indicates that no confidence interval needs to be printed in reports formatted by report, and shortReport. |
void |
setConfidenceIntervalNormal()
Indicates that a confidence interval on the true mean, based on the central limit theorem, needs to be included in reports formatted by report and shortReport. |
void |
setConfidenceIntervalStudent()
Indicates that a confidence interval on the true mean, based on the normality assumption, needs to be included in reports formatted by report and shortReport. |
void |
setConfidenceLevel(double level)
Sets the level of confidence for the intervals on the mean displayed in reports. |
void |
setShowNumberObs(boolean showNumObs)
Determines if the number of observations must be displayed in reports. |
String |
shortReport()
Formats and returns a short statistical report for this tally. |
String |
shortReportHeader()
Returns a string containing the name of the values returned in the report strings. |
double |
standardDeviation()
Returns the sample standard deviation of the observations since the last initialization. |
double |
variance()
Returns the sample variance of the observations since the last initialization. |
| Methods inherited from class umontreal.iro.lecuyer.stat.StatProbe |
|---|
addObservationListener, clearObservationListeners, getName, isBroadcasting, isCollecting, max, min, notifyListeners, removeObservationListener, report, report, setBroadcasting, setCollecting, setName, sum |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Tally()
public Tally(String name)
name - name of the tally| Method Detail |
|---|
public void init()
StatProbe
init in class StatProbepublic void add(double x)
notifyListeners.
x - observation being added to this tallypublic int numberObs()
public double average()
StatProbe
average in class StatProbepublic double variance()
public double standardDeviation()
public void confidenceIntervalNormal(double level,
double[] centerAndRadius)
level - desired probability that the (random) confidence
interval covers the true mean (a constant)centerAndRadius - array of size 2 in which are returned the center
and radius of the confidence interval, respectively
public void confidenceIntervalStudent(double level,
double[] centerAndRadius)
level - desired probability that the (random) confidence
interval covers the true mean (a constant)centerAndRadius - array of size 2 in which are returned the center
and radius of the confidence interval, respectively
public String formatConfidenceIntervalNormal(double level,
int d)
public String formatConfidenceIntervalNormal(double level)
public String formatCINormal(double level,
int d)
confidenceIntervalNormal,
but returns the confidence interval in a formatted string of the form
level - desired probability that the (random) confidence
interval covers the true mean (a constant)d - number of fractional decimal digits
public String formatCINormal(double level)
level - desired probability that the (random) confidence
interval covers the true mean (a constant)
public String formatConfidenceIntervalStudent(double level,
int d)
public String formatConfidenceIntervalStudent(double level)
public String formatCIStudent(double level,
int d)
confidenceIntervalStudent,
but returns the confidence interval in a formatted string of the form
level - desired probability that the (random) confidence
interval covers the true mean (a constant)d - number of fractional decimal digits
public String formatCIStudent(double level)
level - desired probability that the (random) confidence
interval covers the true mean (a constant)
public void confidenceIntervalVarianceChi2(double level,
double[] interval)
level - desired probability that the (random) confidence
interval covers the true mean (a constant)interval - array of size 2 in which are returned the left
and right boundaries of the confidence interval, respectively
public String formatCIVarianceChi2(double level,
int d)
confidenceIntervalVarianceChi2,
but returns the confidence interval in a formatted string of the form
level - desired probability that the (random) confidence
interval covers the true varianced - number of fractional decimal digits
public String report()
report in class StatProbe
public String report(double level,
int d)
level - desired probability that the confidence
interval covers the true meand - number of fractional decimal digits
public String shortReportHeader()
StatProbe
System.out.println (probe1.shortReportHeader());
System.out.println (probe1.getName() + " " + probe1.shortReport());
System.out.println (probe2.getName() + " " + probe2.shortReport());
...
Alternatively, one can use report (String,StatProbe[])
to get a report with aligned probe names.
shortReportHeader in class StatProbepublic String shortReport()
shortReport in class StatProbe
public String reportAndConfidenceIntervalStudent(double level,
int d)
public String reportAndConfidenceIntervalStudent(double level)
public String reportAndCIStudent(double level,
int d)
report), followed by a confidence interval (as in
formatCIStudent), using d fractional decimal digits.
level - desired probability that the (random) confidence
interval covers the true mean (a constant)d - number of fractional decimal digits
public String reportAndCIStudent(double level)
reportAndCIStudent
(level, 3).
level - desired probability that the (random) confidence
interval covers the true mean (a constant)
public double getConfidenceLevel()
public void setConfidenceLevel(double level)
level - desired probability that the (random) confidence
interval covers the true mean (a constant)public void setConfidenceIntervalNone()
report, and shortReport.
This restores the default behavior of the reporting system.
public void setConfidenceIntervalNormal()
report and shortReport. The confidence interval is
formatted using formatCINormal.
public void setConfidenceIntervalStudent()
report and shortReport.
The confidence interval is formatted using formatCIStudent.
public void setShowNumberObs(boolean showNumObs)
showNumObs - the value of the indicator.public Tally clone()
clone in class StatProbe
|
SSJ V. 2.0. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||