|
SSJ V. labo. |
||||||||
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.FunctionOfMultipleMeansTally
public class FunctionOfMultipleMeansTally
Represents a statistical collector for estimating a function of multiple means with a confidence interval based on the delta theorem. Let bar(X)n = (bar(X)n, 0,…, bar(X)n, d-1) be a random vector computed by averaging vectors of observations:
This class collects X vectors in order to compute
g(bar(X)n), to
estimate
ν = g(μ) with a confidence interval.
The function
g(μ) as well as its gradient
∇g(μ) are defined using
an implementation of MultivariateFunction
.
This class defines the methods add
(double[]) for adding
vectors of observations to the tally, average
() for
estimating ν, and confidenceIntervalDelta
(double,
double[]) for applying the delta theorem
to compute a confidence interval on ν.
It uses an internal
ListOfTalliesWithCovariance
instance
to manage the tallies and covariance estimation.
Constructor Summary | |
---|---|
FunctionOfMultipleMeansTally(MultivariateFunction func,
int d)
Constructs a function of multiple means tally with dimension d, and function func. |
|
FunctionOfMultipleMeansTally(MultivariateFunction func,
ListOfTalliesWithCovariance<Tally> ta)
Constructs a function of multiple means tally using the function func and the list of tallies ta for observation management and covariance estimation. |
|
FunctionOfMultipleMeansTally(MultivariateFunction func,
String name,
int d)
Constructs a function of multiple means tally with name name, dimension d, and function func. |
Method Summary | |
---|---|
void |
add(double... x)
Adds a new vector x = (X0,…, Xd-1) of observations to this tally. |
double |
average()
Computes bar(ν)n = g(bar(X)n), an estimate of the function of means ν. |
FunctionOfMultipleMeansTally |
clone()
Clones this object. |
void |
confidenceIntervalDelta(double level,
double[] centerAndRadius)
Computes a confidence interval with confidence level level on ν = g(μ), using the delta theorem. |
String |
formatCIDelta(double level)
Same as formatCIDelta (level, 3). |
String |
formatCIDelta(double level,
int d)
Similar to confidenceIntervalDelta ,
but returns the confidence interval in a formatted string of the form
``95% confidence interval for function of means: (32.431, 32.487)'',
using d decimal digits of accuracy. |
double |
getConfidenceLevel()
Returns the level of confidence for the intervals on the mean displayed in reports. |
int |
getDimension()
Returns the dimension of this tally, i.e., the size of any vector of observations. |
MultivariateFunction |
getFunction()
Returns the function of multiple means used by this tally. |
ListOfTalliesWithCovariance<Tally> |
getListOfTallies()
Returns the (unmodifiable) list of tallies internally used by this object. |
void |
init()
. |
double |
max()
Returns Double.NaN. |
double |
min()
Returns Double.NaN. |
int |
numberObs()
Returns the number of vectors of observations given to this probe since its last initialization. |
String |
report()
Returns a string containing a formatted report on this probe. |
String |
reportAndCIDelta(double level)
Same as reportAndCIDelta
(level, 3). |
String |
reportAndCIDelta(double level,
int d)
Returns a string containing a formatted report on this probe (as in report ), followed by a confidence interval
(as in formatCIDelta ). |
void |
setConfidenceIntervalDelta()
Indicates that a confidence interval on the true mean, based on the delta and central limit theorems, needs to be included in reports formatted by report , and shortReport . |
void |
setConfidenceIntervalNone()
Indicates that no confidence interval needs to be printed 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 |
setName(String name)
. |
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 function of multiple means tally. |
String |
shortReportHeader()
. |
double |
standardDeviation()
Returns the square root of variance . |
double |
sum()
Returns Double.NaN. |
double |
variance()
Estimates nVar(g(bar(X)n)) where n is the number of vectors of observations given to this collector since the last initialization. |
Methods inherited from class umontreal.iro.lecuyer.stat.StatProbe |
---|
addObservationListener, clearObservationListeners, getName, isBroadcasting, isCollecting, notifyListeners, removeObservationListener, report, report, setBroadcasting, setCollecting |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FunctionOfMultipleMeansTally(MultivariateFunction func, int d)
func
- the function being computed.d
- the dimension of the tally.
NegativeArraySizeException
- if d is negative.public FunctionOfMultipleMeansTally(MultivariateFunction func, String name, int d)
func
- the function being computed.name
- the name of the tally.d
- the dimension of the tally.
NegativeArraySizeException
- if d is negative.public FunctionOfMultipleMeansTally(MultivariateFunction func, ListOfTalliesWithCovariance<Tally> ta)
func
- the function being computed.ta
- the list of tallies to be used.
NullPointerException
- if ta is null.Method Detail |
---|
public void setName(String name)
StatProbe
setName
in class StatProbe
public ListOfTalliesWithCovariance<Tally> getListOfTallies()
add
.
public MultivariateFunction getFunction()
public int getDimension()
public void add(double... x)
x
- the vector of observations being added.
NullPointerException
- if x is null.
IllegalArgumentException
- if the length of x
does not correspond to the dimension of this tally.public int numberObs()
public double average()
average
in class StatProbe
public double variance()
public double standardDeviation()
variance
.
public void confidenceIntervalDelta(double level, double[] centerAndRadius)
ListOfTallies
.
The confidence interval is computed based on the statistic
average
is the average of these
observations, and Sn = standardDeviation
is the standard
deviation. Under the previous assumptions,
Z has the normal distribution with mean 0 and variance 1.
The confidence interval given by this method is valid only if
these assumptions are approximately verified.
level
- desired probability that the (random) confidence
interval covers the true function of means (a constant).centerAndRadius
- array of size 2 in which are returned the center
and radius of the confidence interval, respectively.public String formatCIDelta(double level, int d)
confidenceIntervalDelta
,
but returns the confidence interval in a formatted string of the form
``95% confidence interval for function of means: (32.431, 32.487)'',
using d decimal digits of accuracy.
level
- desired probability that the confidence
interval covers the true function of means.d
- the number of decimal digits of accuracy.
public String formatCIDelta(double level)
formatCIDelta
(level, 3).
public String report()
report
in class StatProbe
public String reportAndCIDelta(double level, int d)
report
), followed by a confidence interval
(as in formatCIDelta
).
level
- desired probability that the confidence
interval covers the true mean.d
- the number of decimal digits of accuracy.
public String reportAndCIDelta(double level)
reportAndCIDelta
(level, 3).
level
- desired probability that the confidence
interval covers the true mean.
public String shortReportHeader()
StatProbe
shortReportHeader
in class StatProbe
public String shortReport()
shortReport
in class StatProbe
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 setConfidenceIntervalDelta()
report
, and shortReport
.
The confidence interval is formatted using formatCIDelta
.
public void setShowNumberObs(boolean showNumObs)
showNumObs
- the value of the indicator.public double min()
min
in class StatProbe
public double max()
max
in class StatProbe
public double sum()
sum
in class StatProbe
public void init()
StatProbe
init
in class StatProbe
public FunctionOfMultipleMeansTally clone()
clone
in class StatProbe
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |