|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.markovchain.ArrayOfComparableChains
public class ArrayOfComparableChains
Permits one to simulate an array of MarkovChainComparable
using the array-RQMC method of[#!vLEC05a!#], where n copies of
the chain are simulated in parallel, and sorted using a
multi-dimensional sort (see
MultiDimSort
) at each
step of the chain. The transitions of the n chains at any given
step are determined from the n points of a d-dimensional RQMC
PointSet
, where d is
the number of uniforms required at each step of the chain. The
PointSet
is randomized
at each step using a
PointSetRandomization
.
Constructor Summary | |
---|---|
ArrayOfComparableChains(MarkovChainComparable baseChain)
Same as ArrayOfComparableChains (baseChain, new RandomShift(new MRG32k3a()), new SplitSort(baseChain.stateDim)). |
|
ArrayOfComparableChains(MarkovChainComparable baseChain,
PointSetRandomization rand,
MultiDimSort sort)
Creates an array of the comparable chain baseChain. |
Method Summary | |
---|---|
double |
calcMeanPerf()
Computes and returns the mean performance of the n chains. |
MarkovChainComparable[] |
getChains()
Returns the underlying array of n MarkovChainComparable . |
int |
getN()
Returns the number n of chains. |
double[] |
getPerformances()
Returns the performance of the n chains in an array. |
PointSetRandomization |
getRandomization()
Returns the internal PointSetRandomization . |
MultiDimSort |
getSort()
Returns the MultiDimSort used. |
void |
initialStates()
Initializes the n copies (clones) of the chain baseChain to their initial state by calling initialState () on each chain. |
void |
makeCopies(int n)
Creates n copies (clones) of the chain baseChain and puts them in an array, ready for the array RQMC simulation. |
void |
setRandomization(PointSetRandomization rand)
Sets the internal PointSetRandomization
to rand. |
void |
setSort(MultiDimSort sort)
Sets MultiDimSort to
sort. |
double |
simulArrayRQMC(PointSet p,
int numSteps)
Simulates the n copies of the chain, numSteps steps for each copy, using 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. |
int |
simulOneStepArrayRQMC(PointSet p)
Simulates the n copies of the chain, one step for each copy, using 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. |
String |
simulReplicatesArrayRQMC(PointSet p,
int m,
int numSteps,
Tally statReps)
Performs m independent replications of an array-RQMC simulation as in simulArrayRQMC. |
void |
sortChains()
Sorts the chains using the stored MultiDimSort . |
void |
sortNotStoppedChains()
Sorts the chains that have not stopped yet using the stored MultiDimSort . |
String |
testImprovementArrayRQMC(PointSet p,
int m,
int numSteps,
double varMC,
Tally statReps)
Similar to simulReplicatesArrayRQMC, but also gives the variance improvement factor with respect to MC, assuming that varMC gives the variance per run for MC. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayOfComparableChains(MarkovChainComparable baseChain, PointSetRandomization rand, MultiDimSort sort)
makeCopies
must be called to make the copies.
rand will be used to randomize the point sets in the
simulations. sort will be used to sort the chains.
public ArrayOfComparableChains(MarkovChainComparable baseChain)
ArrayOfComparableChains
(baseChain, new RandomShift(new MRG32k3a()), new SplitSort(baseChain.stateDim)).
Method Detail |
---|
public void makeCopies(int n)
public void initialStates()
initialState
() on each chain.
public double[] getPerformances()
public int getN()
public MarkovChainComparable[] getChains()
MarkovChainComparable
.
public void setRandomization(PointSetRandomization rand)
PointSetRandomization
to rand.
public PointSetRandomization getRandomization()
PointSetRandomization
.
public void setSort(MultiDimSort sort)
MultiDimSort
to
sort.
public MultiDimSort getSort()
MultiDimSort
used.
public int simulOneStepArrayRQMC(PointSet p)
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. The points are randomized before the simulation using the stored
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 the number of chains that have not stopped yet.
public double simulArrayRQMC(PointSet p, int numSteps)
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. At each step, the points are randomized using the stored
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 the average performance per run.
public double calcMeanPerf()
public String simulReplicatesArrayRQMC(PointSet p, int m, int numSteps, Tally statReps)
public String testImprovementArrayRQMC(PointSet p, int m, int numSteps, double varMC, Tally statReps)
public void sortNotStoppedChains()
MultiDimSort
. All the
stopped chains are placed at the end, then the chains that have
not stopped are sorted.
public void sortChains()
MultiDimSort
.
|
SSJ V. labo. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |