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

Similar to ArrayOfComparableChains, except that instead of working with \(n\) clones of a MarkovChain, we use a single. More...

Inheritance diagram for umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains:
umontreal.ssj.markovchainrqmc.ArrayOfComparableChains< T extends MarkovChainComparable >

Public Member Functions

 ArrayOfDoubleChains (MarkovChainDouble baseChain, PointSetRandomization rand)
 Creates a virtual array for the chain baseChain.
 ArrayOfDoubleChains (MarkovChainDouble baseChain)
 Same as ArrayOfDoubleChains(baseChain, new RandomShift(new MRG32k3a())).
void makeCopies (int n)
 Creates the vector of states for n copies of the base chain.
void setStatesDouble (double[] S)
 Sets the states of the n copies of the base chain to S.
double[] getStatesDouble ()
 Returns the array containing the states of the n chains.
void initStatesDouble ()
 Initializes the states of the n copies of the base chain.
boolean simulOneStepArrayRQMC (int step, PointSet p)
 Simulate one step for the n copies of the base chain, assuming that we are at step step.
double simulArrayRQMC (PointSet p, int numSteps)
 Simulates the \(n\) copies of the chain, numSteps steps for each copy, using point set p, where \(n\) is the current number of copies of the chain and is assumed to equal the number of points in p.
double calcMeanPerf ()
 Computes and returns the mean performance of the \(n\) chains.
void sortChains ()
 Sorts the arrays containing the states of the \(n\) chains.
String toString ()
 Creates a String with the states.
Public Member Functions inherited from umontreal.ssj.markovchainrqmc.ArrayOfComparableChains< T extends MarkovChainComparable >
 ArrayOfComparableChains (T baseChain)
 Creates an array of the comparable chain baseChain.
 ArrayOfComparableChains (T baseChain, PointSetRandomization rand, MultiDimSort< T > sort)
 Creates an array of the comparable chain baseChain.
void initialStates ()
 Initializes the n copies (clones) of the chain baseChain to their initial state by calling initialState() on each chain.
int getN ()
 Returns the number n of chains.
T[] getChains ()
 Returns the underlying array of n MarkovChainComparable.
void setRandomization (PointSetRandomization rand)
 Sets the internal umontreal.ssj.hups.PointSetRandomization to rand.
PointSetRandomization getRandomization ()
 Returns the internal umontreal.ssj.hups.PointSetRandomization.
void setSort (MultiDimSort< T > sort)
 Sets the internal umontreal.ssj.util.MultiDimSort to sort.
MultiDimSort< T > getSort ()
 Returns the saved umontreal.ssj.util.MultiDimSort.
int simulOneStepArrayRQMC (PointSet p, PointSetRandomization rand, MultiDimSort< T > sort, int sortCoordPts)
 Randomized the point set p and Simulates the \(n\) copies of the chain, one step for each copy, using.
int simulOneStepArrayRQMC (PointSet p)
 This version uses the preselected randomization and sort, with sortCoordPts = 0.
double simulArrayRQMC (PointSet p, PointSetRandomization rand, MultiDimSort< T > sort, int sortCoordPts, int numSteps)
 Simulates the \(n\) copies of the chain, numSteps steps for each copy, using umontreal.ssj.hups.PointSet p, where \(n\) is the current number of copies (clones) of the chain and is assumed to equal the number of points in p.
double simulArrayRQMC (PointSet p, PointSetRandomization rand, MultiDimSort< T > sort, int numSteps)
 This version assumes that sortCoordPts = 0, so that there is no need to sort the points at each step.
double[] getPerformances ()
 Returns the vector for performances for the \(n\) chains.
void simulReplicatesArrayRQMC (PointSet p, PointSetRandomization rand, MultiDimSort< T > sort, int sortCoordPts, int numSteps, int m, Tally statReps)
 Performs m independent replications of an array-RQMC simulation as in simulArrayRQMC.
String simulReplicatesArrayRQMCFormat (PointSet p, PointSetRandomization rand, MultiDimSort< T > sort, int sortCoordPts, int numSteps, int m, Tally statReps)
 Performs m independent replications of an array-RQMC simulation as in simulFormatArrayRQMC.
String varianceImprovementFormat (double varRQMC, double varMC)
 Returns a string that reports the the ratio of MC variance per run varMC over the RQMC variance per run varRQMC.
String testVarianceRateFormat (PointSet[] pointSets, PointSetRandomization rand, MultiDimSort< T > sort, int sortCoordPts, int numSteps, int m, double varMC, String filenamePlot, String methodLabel)
 Performs an experiment to estimate the convergence rate of the RQMC variance as a function of \(n\), by invoking #simulReplicatesArrayRQMC(r) epeatedly with a given array of point sets of different sizes \(n\).
String testVarianceRateFormat (RQMCPointSet[] rqmcPts, MultiDimSort< T > sort, int sortCoordPts, int numSteps, int m, double varMC, String filenamePlot, String methodLabel)
 Same as above, but produces a plot of the mean and the variance as a function of the step.
void sortNotStoppedChains (MultiDimSort< T > sort)
 Sorts the chains that have not stopped yet using the stored.

Additional Inherited Members

Public Attributes inherited from umontreal.ssj.markovchainrqmc.ArrayOfComparableChains< T extends MarkovChainComparable >
Tally[] performancePerRun
 Performance measure at each step of the chain.

Detailed Description

Similar to ArrayOfComparableChains, except that instead of working with \(n\) clones of a MarkovChain, we use a single.

MarkovChainDouble object for all the chains. The states of the chains are maintained in an array of real numbers (double) and the MarkovChainDouble.nextStepDouble method is used to advance each chain by one step. The performance measure is assumed to be additive over all steps of all copies of the chain. The sum is maintained in a single accumulator for all copies of the chain, updated at each step of each copy.

Another difference with ArrayOfComparableChains is that here, no coordinate of the RQMC points is used for the sort. The points are assumed to be sorted correctly but not by their first coordinate. It is assumed that the points are sorted by a virtual (implicit) extra coordinate which is \(i/n\) for point \(i\), so the first coordinate must not be \(i/n\).

Definition at line 32 of file ArrayOfDoubleChains.java.

Constructor & Destructor Documentation

◆ ArrayOfDoubleChains() [1/2]

umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.ArrayOfDoubleChains ( MarkovChainDouble baseChain,
PointSetRandomization rand )

Creates a virtual array for the chain baseChain.

The method makeCopies must be called to make the copies.

Definition at line 42 of file ArrayOfDoubleChains.java.

◆ ArrayOfDoubleChains() [2/2]

umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.ArrayOfDoubleChains ( MarkovChainDouble baseChain)

Member Function Documentation

◆ calcMeanPerf()

double umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.calcMeanPerf ( )

Computes and returns the mean performance of the \(n\) chains.

Reimplemented from umontreal.ssj.markovchainrqmc.ArrayOfComparableChains< T extends MarkovChainComparable >.

Definition at line 147 of file ArrayOfDoubleChains.java.

◆ getStatesDouble()

double[] umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.getStatesDouble ( )

Returns the array containing the states of the n chains.

Definition at line 80 of file ArrayOfDoubleChains.java.

◆ initStatesDouble()

void umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.initStatesDouble ( )

Initializes the states of the n copies of the base chain.

Definition at line 87 of file ArrayOfDoubleChains.java.

◆ makeCopies()

void umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.makeCopies ( int n)

Creates the vector of states for n copies of the base chain.

Reimplemented from umontreal.ssj.markovchainrqmc.ArrayOfComparableChains< T extends MarkovChainComparable >.

Definition at line 58 of file ArrayOfDoubleChains.java.

◆ setStatesDouble()

void umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.setStatesDouble ( double[] S)

Sets the states of the n copies of the base chain to S.

Definition at line 67 of file ArrayOfDoubleChains.java.

◆ simulArrayRQMC()

double umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.simulArrayRQMC ( PointSet p,
int numSteps )

Simulates the \(n\) copies of the chain, numSteps steps for each copy, using point set p, where \(n\) is the current number of copies of the chain and is assumed to equal the number of points in p.

At each step, the points are randomized using the stored

umontreal.ssj.hups.PointSetRandomization. The dimension of p must be at least as large as the number of uniforms required to simulate one step of the chain. That is, no coordinate is used for the sort, so the user must be careful that the points of p are not sorted by their first coordinate. Returns the average performance per run.

Reimplemented from umontreal.ssj.markovchainrqmc.ArrayOfComparableChains< T extends MarkovChainComparable >.

Definition at line 133 of file ArrayOfDoubleChains.java.

◆ simulOneStepArrayRQMC()

boolean umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.simulOneStepArrayRQMC ( int step,
PointSet p )

Simulate one step for the n copies of the base chain, assuming that we are at step step.

The points are randomized before the simulation using the stored

umontreal.ssj.hups.PointSetRandomization. The dimension of p must be at least as large as the number of uniforms required to simulate one step of the chain. Returns true if and only if all chains have stopped. Compute and stores the performances.

Definition at line 102 of file ArrayOfDoubleChains.java.

◆ sortChains()

void umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.sortChains ( )

Sorts the arrays containing the states of the \(n\) chains.

Reimplemented from umontreal.ssj.markovchainrqmc.ArrayOfComparableChains< T extends MarkovChainComparable >.

Definition at line 158 of file ArrayOfDoubleChains.java.

◆ toString()

String umontreal.ssj.markovchainrqmc.ArrayOfDoubleChains.toString ( )

Creates a String with the states.

Definition at line 165 of file ArrayOfDoubleChains.java.


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