|
SSJ V. 1.2.5. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
umontreal.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 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. |
Object |
clone()
Clone this object. |
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. |
String |
formatCIStudent(double level)
An alias for formatConfidenceIntervalStudent . |
String |
formatCIStudent(double level,
int d)
An alias for formatConfidenceIntervalStudent . |
String |
formatConfidenceIntervalStudent(double level)
|
String |
formatConfidenceIntervalStudent(double level,
int d)
Similar to confidenceIntervalStudent ,
but returns the confidence interval in a formatted string of the form
``95% confidence interval for mean: (32.431, 32.487)'',
using d decimal digits of accuracy. |
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 |
reportAndCIStudent(double level)
An alias for reportAndConfidenceIntervalStudent . |
String |
reportAndCIStudent(double level,
int d)
An alias for reportAndConfidenceIntervalStudent . |
String |
reportAndConfidenceIntervalStudent(double level)
Same as reportAndConfidenceIntervalStudent (level, 3). |
String |
reportAndConfidenceIntervalStudent(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 formatConfidenceIntervalStudent ),
using d decimal digits of accuracy. |
double |
standardDeviation()
Returns the standard deviation of the observations since the last initialization. |
double |
variance()
Returns the variance of the observations since the last initialization. |
Methods inherited from class umontreal.iro.lecuyer.stat.StatProbe |
---|
getName, max, min, setBroadcasting, setCollecting, setName, sum |
Methods inherited from class java.util.Observable |
---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
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 tallyMethod Detail |
---|
public void init()
StatProbe
init
in class StatProbe
public void add(double x)
notifyObservers
(new Double (x))
inherited from
Observable
.
x
- observation being added to this tallypublic int numberObs()
public double average()
StatProbe
average
in class StatProbe
public double variance()
public double standardDeviation()
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, respectivelypublic String formatConfidenceIntervalStudent(double level, int d)
confidenceIntervalStudent
,
but returns the confidence interval in a formatted string of the form
``95% confidence interval for mean: (32.431, 32.487)'',
using d decimal digits of accuracy.
level
- desired probability that the (random) confidence
interval covers the true mean (a constant)d
- number of decimal digits of accuracy
public String formatConfidenceIntervalStudent(double level)
public String formatCIStudent(double level, int d)
formatConfidenceIntervalStudent
.
level
- desired probability that the (random) confidence
interval covers the true mean (a constant)d
- number of decimal digits of accuracy
public String formatCIStudent(double level)
formatConfidenceIntervalStudent
.
level
- desired probability that the (random) confidence
interval covers the true mean (a constant)
public String report()
report
in class StatProbe
public String reportAndConfidenceIntervalStudent(double level, int d)
report
), followed by a confidence interval
(as in formatConfidenceIntervalStudent
),
using d decimal digits of accuracy.
level
- desired probability that the (random) confidence
interval covers the true mean (a constant)d
- number of decimal digits of accuracy
public String reportAndConfidenceIntervalStudent(double level)
reportAndConfidenceIntervalStudent
(level, 3).
level
- desired probability that the (random) confidence
interval covers the true mean (a constant)
public String reportAndCIStudent(double level, int d)
reportAndConfidenceIntervalStudent
.
level
- desired probability that the (random) confidence
interval covers the true mean (a constant)d
- number of decimal digits of accuracy
public String reportAndCIStudent(double level)
reportAndConfidenceIntervalStudent
.
level
- desired probability that the (random) confidence
interval covers the true mean (a constant)
public Object clone()
clone
in class StatProbe
|
SSJ V. 1.2.5. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |