SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.mcqmctools.RQMCExperimentSeries Class Reference

This class offers facilities to perform experiments on the convergence of the variance when estimating a mean (expectation) with a series of RQMC point sets usually of the same type, but different sizes \(n\). More...

Public Member Functions

 RQMCExperimentSeries ()
 Constructor without RQMC point sets.
 RQMCExperimentSeries (RQMCPointSet[] theSets, double base)
 Constructor with a given series of RQMC point sets.
void init (RQMCPointSet[] theSets, double base)
 Resets the array of RQMC point sets for this object, and initializes (re-creates) the arrays that will contain the results.
void setExecutionDisplay (boolean display)
 When set to true, a real-time display of execution results and CPU times will be printed on the default output.
void setBase (double b)
 Sets the base for the logs to b.
double getBase ()
 Returns the base used for the logs.
RQMCPointSet getSet (int i)
 Returns the point set number i associated to this object (starts at 0).
double[] getValuesn ()
 Returns the vector of values of n, after an experiment.
double[] getLogn ()
 Returns the vector of log_base(n), after an experiment.
double[] getMeans ()
 Returns the vector of means from last experiment, after an experiment.
double[] getVariances ()
 Returns the vector of variances from the last experiment.
double[] getLogVariances ()
 Returns the vector of log_base of variances from the last experiment.
void testVarianceRate (MonteCarloModelDouble model, int m)
 Performs an RQMC experiment with the given model, with this series of RQMC point sets.
void testVarianceRateCV (MonteCarloModelCV model, int m)
 Similar to testVarianceRate, but with control variates, all centered at 0.
double[] regressionLogVariance (int numSkip)
 Performs a linear regression of log(variance) vs log(n), and returns the coefficients (constant and slope) in two-dimensional vector.
String formatRegression (double[] regCoeff)
 Takes the regression coefficients of log(variance) in #regCoeff and returns a two-line string that reports on these coefficients.
String reportVarianceRate (int numSkip, boolean details)
 Produces and returns a report on the last experiment.
PgfDataTable toPgfDataTable (String tableName, String tableLabel)
 Takes the data from the most recent experiment and returns it in a PgfDataTable.
String dataForPlot ()
 Returns the data on the mean and variance for each n, in an appropriate format to produce a plot with the pgfplot package.
String dataLogForPlot ()
 Similar to dataForPlot, but for the log(variance) in terms of log n.
String testVarianceRateManyPointTypes (MonteCarloModelDouble model, ArrayList< RQMCPointSet[]> list, int m, int numSkip, boolean makePgfTable, boolean printReport, boolean details, ArrayList< PgfDataTable > listCurves)
 Performs an experiment (testVarianceRate) for each point set series in the given list, and returns a report as a string.
String toString ()
 Performs an experiment (testVarianceRate) for each point set series in the given list, and returns a report as a string.

Detailed Description

This class offers facilities to perform experiments on the convergence of the variance when estimating a mean (expectation) with a series of RQMC point sets usually of the same type, but different sizes \(n\).

The series of RQMC point sets of different sizes can be passed in an array to the constructor. The method testVarianceRate performs an experiment with a given MonteCarloModelDouble and the series of point sets. In this experiment, for each size \(n\) of point set, \(m\) independent replicates of the RQMC estimator (which is an average over RQMC \(n\) points) are computed. One can then recover the average and the empirical variance of these \(m\) replicates of the \(n\)-point average, their logs in any base, etc., in arrays, as well as the estimated linear regression of log(variance) as a function of log(n).

One can also perform experiments with many such series of point sets for the same model, and display the results for the different series on the same plot. Likewise, one can also perform an experiment with many different estimators for the same model and same point sets.

Definition at line 56 of file RQMCExperimentSeries.java.

Constructor & Destructor Documentation

◆ RQMCExperimentSeries() [1/2]

umontreal.ssj.mcqmctools.RQMCExperimentSeries.RQMCExperimentSeries ( )

Constructor without RQMC point sets.

Must use init() afterwards

Parameters
basethe base used for all logarithms.

Definition at line 81 of file RQMCExperimentSeries.java.

◆ RQMCExperimentSeries() [2/2]

umontreal.ssj.mcqmctools.RQMCExperimentSeries.RQMCExperimentSeries ( RQMCPointSet[] theSets,
double base )

Constructor with a given series of RQMC point sets.

Parameters
theSetsthe RQMC point sets.
basethe base used for all logarithms.

Definition at line 89 of file RQMCExperimentSeries.java.

Member Function Documentation

◆ dataForPlot()

String umontreal.ssj.mcqmctools.RQMCExperimentSeries.dataForPlot ( )

Returns the data on the mean and variance for each n, in an appropriate format to produce a plot with the pgfplot package.

Returns
Report as a string.

Definition at line 339 of file RQMCExperimentSeries.java.

◆ dataLogForPlot()

String umontreal.ssj.mcqmctools.RQMCExperimentSeries.dataLogForPlot ( )

Similar to dataForPlot, but for the log(variance) in terms of log n.

Returns
Report as a string.

Definition at line 353 of file RQMCExperimentSeries.java.

◆ formatRegression()

String umontreal.ssj.mcqmctools.RQMCExperimentSeries.formatRegression ( double[] regCoeff)

Takes the regression coefficients of log(variance) in #regCoeff and returns a two-line string that reports on these coefficients.

Parameters
regCoeffthe regression coefficients.
Returns
Report as a string.

Definition at line 276 of file RQMCExperimentSeries.java.

◆ getBase()

double umontreal.ssj.mcqmctools.RQMCExperimentSeries.getBase ( )

Returns the base used for the logs.

Definition at line 128 of file RQMCExperimentSeries.java.

◆ getLogn()

double[] umontreal.ssj.mcqmctools.RQMCExperimentSeries.getLogn ( )

Returns the vector of log_base(n), after an experiment.

Definition at line 151 of file RQMCExperimentSeries.java.

◆ getLogVariances()

double[] umontreal.ssj.mcqmctools.RQMCExperimentSeries.getLogVariances ( )

Returns the vector of log_base of variances from the last experiment.

Definition at line 174 of file RQMCExperimentSeries.java.

◆ getMeans()

double[] umontreal.ssj.mcqmctools.RQMCExperimentSeries.getMeans ( )

Returns the vector of means from last experiment, after an experiment.

Definition at line 158 of file RQMCExperimentSeries.java.

◆ getSet()

RQMCPointSet umontreal.ssj.mcqmctools.RQMCExperimentSeries.getSet ( int i)

Returns the point set number i associated to this object (starts at 0).

Returns
the ith point set associated to this object

Definition at line 137 of file RQMCExperimentSeries.java.

◆ getValuesn()

double[] umontreal.ssj.mcqmctools.RQMCExperimentSeries.getValuesn ( )

Returns the vector of values of n, after an experiment.

Definition at line 144 of file RQMCExperimentSeries.java.

◆ getVariances()

double[] umontreal.ssj.mcqmctools.RQMCExperimentSeries.getVariances ( )

Returns the vector of variances from the last experiment.

Each variance in the vector is the empirical variance of the m replicates of the RQMC estimator. To obtain the variance per run, it must be multiplied by n.

Definition at line 167 of file RQMCExperimentSeries.java.

◆ init()

void umontreal.ssj.mcqmctools.RQMCExperimentSeries.init ( RQMCPointSet[] theSets,
double base )

Resets the array of RQMC point sets for this object, and initializes (re-creates) the arrays that will contain the results.

Definition at line 97 of file RQMCExperimentSeries.java.

◆ regressionLogVariance()

double[] umontreal.ssj.mcqmctools.RQMCExperimentSeries.regressionLogVariance ( int numSkip)

Performs a linear regression of log(variance) vs log(n), and returns the coefficients (constant and slope) in two-dimensional vector.

The first numSkip values in the array are skipped (not used) to make the regression. This is useful if we want to focus the regression on larger values of n.

Definition at line 260 of file RQMCExperimentSeries.java.

◆ reportVarianceRate()

String umontreal.ssj.mcqmctools.RQMCExperimentSeries.reportVarianceRate ( int numSkip,
boolean details )

Produces and returns a report on the last experiment.

Parameters
numSkipThe first numSkip values of n are skipped for the regression
detailsIf true, gives values (mean, log variance,...) for each n.
Returns
Report as a string.

Definition at line 291 of file RQMCExperimentSeries.java.

◆ setBase()

void umontreal.ssj.mcqmctools.RQMCExperimentSeries.setBase ( double b)

Sets the base for the logs to b.

Definition at line 120 of file RQMCExperimentSeries.java.

◆ setExecutionDisplay()

void umontreal.ssj.mcqmctools.RQMCExperimentSeries.setExecutionDisplay ( boolean display)

When set to true, a real-time display of execution results and CPU times will be printed on the default output.

Definition at line 113 of file RQMCExperimentSeries.java.

◆ testVarianceRate()

void umontreal.ssj.mcqmctools.RQMCExperimentSeries.testVarianceRate ( MonteCarloModelDouble model,
int m )

Performs an RQMC experiment with the given model, with this series of RQMC point sets.

For each set in the series, computes m replicates of the RQMC estimator, then computes the average and the variance of these m replicates, and the logs of n and of the variance in the given base.

Definition at line 184 of file RQMCExperimentSeries.java.

◆ testVarianceRateCV()

void umontreal.ssj.mcqmctools.RQMCExperimentSeries.testVarianceRateCV ( MonteCarloModelCV model,
int m )

Similar to testVarianceRate, but with control variates, all centered at 0.

Definition at line 219 of file RQMCExperimentSeries.java.

◆ testVarianceRateManyPointTypes()

String umontreal.ssj.mcqmctools.RQMCExperimentSeries.testVarianceRateManyPointTypes ( MonteCarloModelDouble model,
ArrayList< RQMCPointSet[]> list,
int m,
int numSkip,
boolean makePgfTable,
boolean printReport,
boolean details,
ArrayList< PgfDataTable > listCurves )

Performs an experiment (testVarianceRate) for each point set series in the given list, and returns a report as a string.

Parameters
model
list
m
Returns
a report on the experiment.

Definition at line 384 of file RQMCExperimentSeries.java.

◆ toPgfDataTable()

PgfDataTable umontreal.ssj.mcqmctools.RQMCExperimentSeries.toPgfDataTable ( String tableName,
String tableLabel )

Takes the data from the most recent experiment and returns it in a PgfDataTable.

This will typically be used to plot the data.

Parameters
tableNameName (short identifier) of the table.
Returns
Report as a string.

Definition at line 317 of file RQMCExperimentSeries.java.

◆ toString()

String umontreal.ssj.mcqmctools.RQMCExperimentSeries.toString ( )

Performs an experiment (testVarianceRate) for each point set series in the given list, and returns a report as a string.

Definition at line 406 of file RQMCExperimentSeries.java.


The documentation for this class was generated from the following file: