SSJ
3.3.1
Stochastic Simulation in Java
|
Provides generic tools to perform simple Monte Carlo experiments with a simulation model that implements one of the interfaces MonteCarloModelDouble, MonteCarloModelDoubleArray, or MonteCarloModelCV. More...
Static Public Member Functions | |
static void | simulateRuns (MonteCarloModelDouble model, int n, RandomStream stream, Tally statValue) |
Performs #n simulation runs of #model using #stream and collects statistics in #statValue. More... | |
static void | simulateRuns (MonteCarloModelDoubleArray model, int n, RandomStream stream, ListOfTallies<? extends Tally > statValueList) |
Similar to simulateRuns(MonteCarloModelDouble, int, RandomStream, Tally) but for a model of type MonteCarloModelDoubleArray. More... | |
static void | simulateRunsCV (MonteCarloModelCV model, int n, RandomStream stream, ListOfTalliesWithCV< Tally > statWithCV) |
Performs n runs of model using #stream and collects statistics for a model with a vector of control variates. More... | |
static void | simulateRunsCV (MonteCarloModelCV model, int n, RandomStream stream, TallyStore statX, TallyStore statC) |
Performs n runs using stream and collects statistics for a model with a single real-valued control variate C. More... | |
static void | simulateRunsCV (MonteCarloModelCV model, int n, RandomStream stream, double[] mean, double[] variance) |
Performs n runs using #stream and collects statistics for a model with a single real-valued control variate C. More... | |
static void | computeMeanVarCV (TallyStore statX, TallyStore statC, double[] mean, double[] variance) |
Given statistics collected in statX and statC as with simulateRunsCV, this method computes the mean and variance of the estimators with and without the CV and returns them in the two-dimensional vectors mean and variance (mean[0] is the value without CV, mean[1] the value with CV, and similarly for the variance. | |
static void | simulFDReplicatesCRN (MonteCarloModelDouble model1, MonteCarloModelDouble model2, double delta, int n, RandomStream stream, Tally statDiff) |
Performs n simulation runs to estimate the difference in performance between model2 and model1 , divided by delta , using common random numbers (CRN) across the two models. More... | |
static void | simulFDReplicatesIRN (MonteCarloModelDouble model1, MonteCarloModelDouble model2, double delta, int n, RandomStream stream, Tally statDiff) |
Similar to simulFDReplicatesCRN, but using independent random numbers (IRN) across the two models. More... | |
static String | simulateRunsDefaultReportStudent (MonteCarloModelDouble model, int n, RandomStream stream, Tally statValue, double level, int d, Chrono timer) |
Performs n independent runs using n substreams of #stream, collects statistics in #statValue, and returns a report with a confidence interval of level #level, with d decimal fractional digits of precision for the output, computed via a Student distribution. | |
static String | simulateRunsDefaultReportStudent (MonteCarloModelDouble model, int n, RandomStream stream, Tally statValue, double level, int d) |
In this version, there is no need to provide a Chrono ; it is created inside. | |
static String | simulateRunsDefaultReportStudent (MonteCarloModelDouble model, int n, RandomStream stream, Tally statValue, Chrono timer) |
A short-hand equivalent for simulateRunsDefaultReportStudent (model, n, stream, statValue, 0.95, 4, timer) | |
static String | simulateRunsDefaultReportStudent (MonteCarloModelDouble model, int n, RandomStream stream, Tally statValue) |
A short-hand equivalent for simulateRunsDefaultReportStudent (model, n, stream, statValue, 0.95, 4) | |
static String | simulateRunsDefaultReportCV (MonteCarloModelCV model, int n, RandomStream stream, ListOfTalliesWithCV< Tally > statWithCV, double level, int d, Chrono timer) |
Similar to simulateRunsDefaultReport, but this one uses a vector of control variates. More... | |
static String | simulateRunsDefaultReportCV (MonteCarloModelCV model, int n, RandomStream stream, ListOfTalliesWithCV< Tally > statWithCV, double level, int d) |
In this one the timer is created internally (and cannot be accessed externally). | |
static String | simulateRunsDefaultReportCV (MonteCarloModelCV model, int n, RandomStream stream, double[] mean, double[] variance, double level, int d, Chrono timer) |
This one uses a single real-valued CV, as in simulateRunsCV. | |
Provides generic tools to perform simple Monte Carlo experiments with a simulation model that implements one of the interfaces MonteCarloModelDouble, MonteCarloModelDoubleArray, or MonteCarloModelCV.
The experiment consists of n
independent simulation runs and the results are returned in Tally satistical collectors. The RandomStream
used for the experiment is reset to a new substream after each run.
|
static |
Performs #n simulation runs of #model using #stream and collects statistics in #statValue.
The #stream is reset to a new substream for each run.
|
static |
Similar to simulateRuns(MonteCarloModelDouble, int, RandomStream, Tally) but for a model of type MonteCarloModelDoubleArray.
Consequently, the statistics are collected in a ListOfTallies. The \(t\)-th element of #statValueList collects the statistics for the \(t\)-th coordinate of the performance vector of #model.
model | the underlying model. |
n | the number of simulation runs |
stream | the stream used to simulate the model |
statValueList | the collector of the statistical data. |
|
static |
Performs n runs of model using #stream and collects statistics for a model with a vector of control variates.
The results are returned in #statWithCV.
|
static |
Performs n runs using stream
and collects statistics for a model with a single real-valued control variate C.
The statistics on X and C are collected in statX
and statC
.
|
static |
Performs n runs using #stream and collects statistics for a model with a single real-valued control variate C.
The statistics are collected, and the mean and variance of the estimators with and without the control variate are returned in the two-dimensional vectors mean
and variance
, as in computeMeanVarCV
.
|
static |
Similar to simulateRunsDefaultReport, but this one uses a vector of control variates.
It returns a report with a confidence interval for the estimator with the CV.
|
static |
Performs n
simulation runs to estimate the difference in performance between model2
and model1
, divided by delta
, using common random numbers (CRN) across the two models.
One substream is used for each run and the same n
substreams are used for the two models. Returns the statistics on the n
differences in statDiff
. By taking delta
= 1, this just estimates the difference. By taking delta
> 0 very small, and if the two models are in fact the same model but with a parameter that differs by delta
, this gives a finite-difference estimator of the derivative of the performance with respect to this parameter.
|
static |
Similar to simulFDReplicatesCRN, but using independent random numbers (IRN) across the two models.
One substream is used for each run of each model, for a total of 2n substreams.