SSJ  3.2.1
Stochastic Simulation in Java
 All Classes Namespaces Functions Variables Pages
Namespaces | Classes
umontreal::ssj::stat Namespace Reference

Tools for Collecting Statistics. More...




class  FunctionOfMultipleMeansTally
 Represents a statistical collector for estimating a function of multiple means with a confidence interval based on the delta theorem [182] . More...
interface  ObservationListener
 Represents an object that can listen to observations broadcast by statistical probes. More...
class  StatProbe
 The objects of this class are statistical probes or collectors, which are elementary devices for collecting statistics. More...
class  Tally
 A subclass of StatProbe. More...
class  TallyHistogram
 This class is an extension of Tally which gives a more detailed view of the observations statistics. More...
class  TallyStore
 This class is a variant of Tally for which the individual observations are stored in a list implemented as a DoubleArrayList. More...

Detailed Description

Tools for Collecting Statistics.

This package provides elementary tools for collecting statistics and computing confidence intervals. The base class umontreal.ssj.stat.StatProbe implements common methods needed by all probes. Its subclass umontreal.ssj.stat.Tally collects data as a sequence of observations \(X_1,X_2,…\), and computes sample averages, sample standard deviations, and confidence intervals based on the normality assumption.

Richard: Toujours basé sur la normale?

The class umontreal.ssj.stat.TallyStore is similar, but it also stores the individual observations in a list implemented as a DoubleArrayList , a class imported from the COLT library . This permits one to compute more quantities and to use the methods provided by COLT for computing descriptive statistics.

The class umontreal.ssj.simevents.Accumulate , in package simevents, computes integrals and averages with respect to time. This class is in package simevents because its operation depends on the simulation clock.

All classes that represent statistical probes support the observer design pattern, well-known in software engineering [59]  . This pattern facilitates the separation of data generation (by the simulation program) from data processing (for statistical reports and displays). This can be very helpful in particular in large simulation programs or libraries, where different objects may need to process the same data in different ways. A statistical probe maintains a list of registered umontreal.ssj.stat.ObservationListener objects, and broadcasts information to all its registered observers whenever appropriate. Any object that implements the interface umontreal.ssj.stat.ObservationListener can register as an observer. For an example, see the program QueueObs in the directory examples.

Subpackages of package stat provide matrices of Tally’s and lists of Tally’s.

When writing complex simulation programs, in data generation portions, one uses the statistical probes as usual but with observation notification turned on. To turn on observation notification, one simply calls umontreal.ssj.stat.StatProbe.notifyObs on the probes. In this mode, a probe becomes a distribution agency which broadcasts received observations to all observers that registered to it. It will also fulfill its collector functionality unless it is disabled explicitly by calling the umontreal.ssj.stat.StatProbe.stopCollectStat method. When the statistical collection is disabled, the probes are only distribution agencies.

Data processing parts of the program are implemented through observers. An observer is a class implementing the Observer interface. It can be registered to any class extending Observable, including umontreal.ssj.stat.StatProbe. The observed value is passed to the observers through the second argument of the java.util.Observer.update method which is an Object. The argument must then be type-casted to a Double wrapper object before the observation value can be extracted.