A special kind of Markov chain whose state space is a subset of the real numbers. More...
Public Member Functions | |
Abstract Methods @{ | |
| abstract double | initialStateDouble () |
| Returns the initial (deterministic) state. | |
| void | initialState () |
| Sets the Markov chain to its (deterministic) initial state and initializes the collectors for the performance measure, ready to start a simulation. | |
| abstract double | nextStepDouble (int step, double s, RandomStream stream) |
| Simulates one step of the chain, from state s, using stream for the randomness, assuming we are at step step. | |
| void | nextStep (RandomStream stream) |
| Simulates one more step of the chain, from its current state, using stream for the randomness. | |
| abstract double | getPerformanceDouble (double state, int numSteps) |
| Returns the performance measure associated with state state, which may depend on the number of steps numSteps. | |
Other Methods @{ | |
| double | getPerformance (int numSteps) |
| Returns the performance mesure associated with current state, which may depend on the number of steps numsteps. | |
| double | getPerformance () |
| Returns the value of perf which is computed when a chain stops. | |
| boolean | hasStopped () |
| Indicates if the chain has stopped. | |
| int | getStateDimension () |
| Returns the dimension of the state. | |
| double | simulStepsDouble (int numSteps, RandomStream stream) |
| After invoking initialStateDouble, starts a new simulation run, simulates numSteps steps of the Markov chain using the given stream, and returns the final state. | |
| void | simulRunsWithSubstreams (int n, int numSteps, RandomStream stream, Tally statRuns) |
| Same as simulRuns, except that the stream is first reset to its initial seed and then reset to the first substream at the beginning and to the next substream after each run. | |
| Public Member Functions inherited from umontreal.ssj.markovchainrqmc.MarkovChain | |
| Object | clone () throws CloneNotSupportedException |
| Returns a clone of the chain. | |
| void | simulSteps (int numSteps, RandomStream stream) |
| Starts a new simulation run and simulates numSteps steps of the Markov chain or until the chain stops, using the given stream. | |
| void | simulSteps (RandomStream stream) |
| Starts a new simulation run and simulates until the stopping time is reached, using the given stream. | |
| void | simulRuns (int n, int numSteps, RandomStream stream, Tally statRuns) |
| Performs n simulation runs of the chain, for numSteps steps per run, using the given stream. | |
| double | simulMC (int n, int numSteps) |
| Perform n simulation runs of the chain, each for numSteps steps, and returns average. | |
| double | simulMC (int n) |
| Perform n runs, each one until the chain stops. | |
| void | simulRepMC (int n, int numSteps, int m, Tally t) |
| Perform n runs and compute the average, reapeat m times and return the stats in t. | |
| void | simulRepMC (int n, int m, Tally t) |
| Same as previous one, but run the chains until they stop. | |
| void | simulRQMC (PointSet p, int m, int numSteps, PointSetRandomization rand, Tally statReps) |
| Performs m independent replicates of \(n\) simulation runs of the chain using a RQMC point set, each time storing the average of the performance over the \(n\) chains. | |
| String | simulRunsFormat (int n, int numSteps, RandomStream stream, Tally statRuns) |
| Same as simulRuns but also returns the results as a formatted string. | |
| String | simulRunsWithSubstreamsFormat (int n, int numSteps, RandomStream stream, Tally statRuns) |
| Same as simulRunsWithSubstreams but also returns the results as a formatted string. | |
| String | simulRQMCFormat (PointSet p, int m, int numSteps, PointSetRandomization rand, Tally statReps) |
| Same as simulRQMC but also returns the results as a formatted string. | |
| String | testImprovementRQMCFormat (PointSet p, int m, int numSteps, PointSetRandomization rand, double varMC, Tally statReps) |
| Similar to simulRQMCFormat, but also gives the variance improvement factor with respect to MC. | |
| String | formatResults (Tally stat) |
| Returns a string containing the mean, the variance, and a 90% confidence interval for stat. | |
| String | formatResultsRQMC (Tally stat, int numPoints) |
| Returns a string containing the mean, the variance multiplied by numPoints, and a 90% confidence interval for stat. | |
| Public Member Functions inherited from umontreal.ssj.util.multidimsort.MultiDimComparable< T > | |
| int | compareTo (T other, int j) |
| Similar to compareTo in the class Comparable, except that one specifies the index \(j\) of the criterion on which the objects are to be compared. | |
A special kind of Markov chain whose state space is a subset of the real numbers.
The state is stored in the double variable state.
The "Double" version of the methods from Markov Chain now returns the state. This makes it possible to simulate several copies of this chain in parallel without cloning and without maintaining the state of the chain in a local variable. The states can be maintained in an external array and at each step, one passes the current state to the method nextStepDouble, which returns the next state. This is exploited in the implementation of ArrayOfDoubleChains.
The methods initialState, nextStep, getPerformance and compareTo, which are abstract in MarkovChainComparable, all have a default implementation here, so the methods of Markov Chain still work.
On the other hand, the abstract methods specified in the present class do not necessarily update local variables.
Abstract method compareTo from class MarkovChainComparable is implemented by comparing variable state of the chains. And method dimension now returns 1, there’s no need to set variable stateDim.
Definition at line 31 of file MarkovChainDouble.java.
| double umontreal.ssj.markovchainrqmc.MarkovChainDouble.getPerformance | ( | ) |
Returns the value of perf which is computed when a chain stops.
Reimplemented from umontreal.ssj.markovchainrqmc.MarkovChain.
Definition at line 90 of file MarkovChainDouble.java.
| double umontreal.ssj.markovchainrqmc.MarkovChainDouble.getPerformance | ( | int | numSteps | ) |
Returns the performance mesure associated with current state, which may depend on the number of steps numsteps.
Definition at line 83 of file MarkovChainDouble.java.
|
abstract |
Returns the performance measure associated with state state, which may depend on the number of steps numSteps.
| int umontreal.ssj.markovchainrqmc.MarkovChainDouble.getStateDimension | ( | ) |
Returns the dimension of the state.
Reimplemented from umontreal.ssj.markovchainrqmc.MarkovChainComparable.
Definition at line 101 of file MarkovChainDouble.java.
| boolean umontreal.ssj.markovchainrqmc.MarkovChainDouble.hasStopped | ( | ) |
Indicates if the chain has stopped.
Reimplemented from umontreal.ssj.markovchainrqmc.MarkovChain.
Definition at line 97 of file MarkovChainDouble.java.
| void umontreal.ssj.markovchainrqmc.MarkovChainDouble.initialState | ( | ) |
Sets the Markov chain to its (deterministic) initial state and initializes the collectors for the performance measure, ready to start a simulation.
Must also set variable stopped to false.
Reimplemented from umontreal.ssj.markovchainrqmc.MarkovChain.
Definition at line 46 of file MarkovChainDouble.java.
|
abstract |
Returns the initial (deterministic) state.
| void umontreal.ssj.markovchainrqmc.MarkovChainDouble.nextStep | ( | RandomStream | stream | ) |
Simulates one more step of the chain, from its current state, using stream for the randomness.
If the chain stops, this method must set variable stopped to true.
Reimplemented from umontreal.ssj.markovchainrqmc.MarkovChain.
Definition at line 60 of file MarkovChainDouble.java.
|
abstract |
Simulates one step of the chain, from state s, using stream for the randomness, assuming we are at step step.
If the chain stops, this method must compute the performance and save it to variable perf, then return Double.POSITIVE_INFINITY. If not, it returns the new state.
| void umontreal.ssj.markovchainrqmc.MarkovChainDouble.simulRunsWithSubstreams | ( | int | n, |
| int | numSteps, | ||
| RandomStream | stream, | ||
| Tally | statRuns ) |
Same as simulRuns, except that the stream is first reset to its initial seed and then reset to the first substream at the beginning and to the next substream after each run.
Reimplemented from umontreal.ssj.markovchainrqmc.MarkovChain.
Definition at line 129 of file MarkovChainDouble.java.
| double umontreal.ssj.markovchainrqmc.MarkovChainDouble.simulStepsDouble | ( | int | numSteps, |
| RandomStream | stream ) |
After invoking initialStateDouble, starts a new simulation run, simulates numSteps steps of the Markov chain using the given stream, and returns the final state.
The simulSteps method in MarkovChain does the same, but returns nothing.
Definition at line 116 of file MarkovChainDouble.java.