|
static int | getRequiredNewObservations (StatProbe[] a, double targetError, double level) |
| Returns the approximate number of additional observations required to reach a relative error smaller than or equal to targetError for each tally in the array a when confidence intervals are computed with confidence level level . More...
|
|
static int | getRequiredNewObservations (Iterable<? extends StatProbe > it, double targetError, double level) |
| Returns the approximate number of additional observations required to reach a relative error smaller than or equal to targetError for each tally enumerated by it when confidence intervals are computed with confidence level level . More...
|
|
static int | getRequiredNewObservations (StatProbe probe, double targetError, double level) |
| Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the statistical probe probe . More...
|
|
static int | getRequiredNewObservationsTally (Tally ta, double targetError, double level) |
| Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the tally ta . More...
|
|
static int | getRequiredNewObservationsTally (FunctionOfMultipleMeansTally fmmt, double targetError, double level) |
| Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the function of multiple means fmmt . More...
|
|
static int | getRequiredNewObservations (double center, double radius, int numberObs, double targetError) |
| Returns the approximate number of additional observations needed for the point estimator \(\bar{X}_n=\) center , computed using \(n=\) numberObs observations and with a confidence interval having radius \(\delta_n/\sqrt{n}=\) radius , to have a relative error less than or equal to \(\epsilon=\) targetError . More...
|
|
Represents a framework for performing experiments using simulation.
This class defines an abstract simulate method that should implement the simulation logic. It also provides utility methods to estimate the required number of additional observations that would be necessary for an estimator to reach a given precision, for sequential sampling.
This class is the base class of BatchMeansSim and RepSim implementing the logic for a simulation on infinite and finite horizon, respectively.
static int getRequiredNewObservations |
( |
StatProbe [] |
a, |
|
|
double |
targetError, |
|
|
double |
level |
|
) |
| |
|
static |
Returns the approximate number of additional observations required to reach a relative error smaller than or equal to targetError
for each tally in the array a
when confidence intervals are computed with confidence level level
.
For each statistical collector in the given array, a confidence interval is computed independently of the other collectors, and an error check is performed by getRequiredNewObservations(StatProbe,double,double) to determine the required number of additional observations. The method returns the maximal number of required observations.
- Parameters
-
a | the array of probes. |
targetError | the target relative error. |
level | the desired probability that, for a given statistical collector, the (random) confidence interval covers the true mean (a constant). |
- Returns
- an estimate of the required number of additional observations to reach the precision.
static int getRequiredNewObservations |
( |
Iterable<? extends StatProbe > |
it, |
|
|
double |
targetError, |
|
|
double |
level |
|
) |
| |
|
static |
Returns the approximate number of additional observations required to reach a relative error smaller than or equal to targetError
for each tally enumerated by it
when confidence intervals are computed with confidence level level
.
For each statistical collector returned by the iterator obtained from it
, a confidence interval is computed independently of the other collectors, and an error check is performed by getRequiredNewObservations(StatProbe,double,double) to determine the required number of additional observations. The method returns the maximal number of required observations.
- Parameters
-
it | the iterable used to enumerate probes. |
targetError | the target relative error. |
level | the desired probability that, for a given statistical collector, the (random) confidence interval covers the true mean (a constant). |
- Returns
- an estimate of the required number of additional observations to reach the precision.
static int getRequiredNewObservations |
( |
StatProbe |
probe, |
|
|
double |
targetError, |
|
|
double |
level |
|
) |
| |
|
static |
Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the statistical probe probe
.
This method always returns 0 if the probe is not a tally. For a umontreal.ssj.stat.Tally, the confidence interval is computed using umontreal.ssj.stat.Tally.confidenceIntervalStudent(double,double[]). For a umontreal.ssj.stat.FunctionOfMultipleMeansTally, it is computed using umontreal.ssj.stat.FunctionOfMultipleMeansTally.confidenceIntervalDelta(double,double[]).
- Parameters
-
probe | the statistical probe being checked. |
targetError | the target relative error. |
level | the desired probability that the (random) confidence interval covers the true mean (a constant). |
- Returns
- the number of required additional observations.
static int getRequiredNewObservations |
( |
double |
center, |
|
|
double |
radius, |
|
|
int |
numberObs, |
|
|
double |
targetError |
|
) |
| |
|
static |
Returns the approximate number of additional observations needed for the point estimator \(\bar{X}_n=\) center
, computed using \(n=\) numberObs
observations and with a confidence interval having radius \(\delta_n/\sqrt{n}=\) radius
, to have a relative error less than or equal to \(\epsilon=\) targetError
.
It is assumed that \(\bar{X}_n\) is an estimator of a mean \(\mu\), \(n\) is the number of observations numberObs
, and that \(\delta_n/\sqrt{n}\to0\) when \(n\to\infty\).
If \(n\) is less than 1, this method returns 0. Otherwise, the relative error given by \(\delta_n/|\sqrt{n}\bar{X}_n|\) should be smaller than or equal to \(\epsilon\). If the inequality is true, this returns 0. Otherwise, the minimal \(n^*\) for which this inequality holds is approximated as follows. The target radius is given by \(\delta^*=\epsilon|\mu|\), which is approximated by \(\epsilon|\bar{X}_n|<\delta_n/\sqrt{n}\). The method must select \(n^*\) for which \(\delta_{n^*}/\sqrt{n^*}\le\delta^*\), which will be approximately true if \(\delta_{n^*}/\sqrt{n^*}\le\epsilon|\bar{X}_n|\). Therefore,
\[ n^*\ge(\delta_{n^*}/(\epsilon|\bar{X}_n|))^2\approx(\delta_n/(\epsilon|\bar{X}_n|))^2. \]
The method returns \(\mathrm{round}((\delta_n\sqrt{n}/(\epsilon|\bar{X}_n|))^2)-n\) where \(\mathrm{round}(\cdot)\) rounds its argument to the nearest integer.
- Parameters
-
center | the value of the point estimator. |
radius | the radius of the confidence interval. |
numberObs | the number of observations. |
targetError | the target relative error. |
- Returns
- an estimate of the required number of additional observations to reach the precision.
- Exceptions
-
IllegalArgumentException | if radius or targetError are negative. |
static int getRequiredNewObservationsTally |
( |
Tally |
ta, |
|
|
double |
targetError, |
|
|
double |
level |
|
) |
| |
|
static |
Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the tally ta
.
The confidence interval is computed using umontreal.ssj.stat.Tally.confidenceIntervalStudent(double,double[]).
- Parameters
-
ta | the tally being checked. |
targetError | the target relative error. |
level | the desired probability that the (random) confidence interval covers the true mean (a constant). |
- Returns
- the number of required additional observations.
Calls getRequiredNewObservations(double,double,int,double) with the average, confidence interval radius, and number of observations given by the function of multiple means fmmt
.
The confidence interval is computed using umontreal.ssj.stat.FunctionOfMultipleMeansTally.confidenceIntervalDelta(double,double[]).
- Parameters
-
fmmt | the function of multiple means being checked. |
targetError | the target relative error. |
level | the desired probability that the (random) confidence interval covers the true mean (a constant). |
- Returns
- the number of required additional observations.