Marmote Core
The project aims at realizing the prototype of a software environment dedicated to modeling with Markov chains.
Public Member Functions | Protected Types | Protected Attributes | List of all members
markovChain Class Reference

Markov Chain class. More...

#include <markovChain.h>

Inheritance diagram for markovChain:
felsenstein81 homogeneous1DBirthDeath homogeneous1DRandomWalk homogeneousMultiDRandomWalk

Public Member Functions

 markovChain (int sz, timeType t)
 Simple constructor for the Markov chain from the size. More...
 
 markovChain (transitionStructure *tr)
 Constructor for the Markov chain using a transition structure. More...
 
 markovChain (string format, string param[], int nbreParam, string modelName, bool isAbstract)
 Constructor for Markov chains from files in various formats. In the abstract form, the object just stores the name(s) of the files that define the mode. In the non-abstract (concrete) form, the chain is instantiated in the memory with a concrete transition structure. Only the ERS, PSI and Xborne formats are supported at this time for concrete chains. More...
 
virtual ~markovChain ()
 Standard destructor. The generator and the initial distrib are destroyed. More...
 
int stateSpaceSize ()
 Read accessor to get the number of states in the state space of the Markov chain. More...
 
transitionStructuregenerator ()
 Read accessor to get the value of _generator which is a transitionStructure. More...
 
void setInitDistribution (discreteDistribution *d)
 Write accessor to set the value of _initDistribution which is a discreteDistribution. More...
 
void setGenerator (transitionStructure *tr)
 Write accessor to set the value of _generator which is a transitionStructure. More...
 
RInsideRmotor ()
 Read accessor to the embedded R engine, a static variable named _Rmotor. When accessed for the first time, an instance of RInside is created. More...
 
Distributionread ()
 Method(s) for deserializing Distribution from Xborne file (.pi). More...
 
void setFormat (string format)
 Utility to set the value of _format. More...
 
void setModelName (string modelName)
 Utility to set the value of _modelName. More...
 
void setAbstractNbre (int abstractNbre)
 Utility to set the value of _abstractNbre. More...
 
void setAbstract (string abstract[])
 Utility to set the value of the table containing names related to the model: file names, extensions etc. More...
 
int abstractNbre ()
 Utility to get _abstractNbre. More...
 
string modelName ()
 Utility to get _modelName. More...
 
string format ()
 Utility to get _format. More...
 
void abstract ()
 Utility to display the value of the table _abstract[]. More...
 
virtual simulationResultsimulateChain (double tMax, bool Stats, bool Traj, bool withIncrements, bool Print)
 Simulates the evolution of a Markov Chain using the PSI program. This is a front-end function to both discrete-time and the continuous-time simulators. More...
 
virtual simulationResultsimulateChainDT (int tMax, bool stats, bool traj, bool trace)
 Simulates the evolution of a discrete-time Markov Chain. More...
 
virtual simulationResultsimulateChainCT (double tMax, bool stats, bool traj, bool withIncrements, bool trace)
 Simulates the evolution of a continuous-time Markov Chain. More...
 
simulationResultsimulatePSI (int tMax, bool stats, bool Traj, bool Print)
 Simulates the evolution of a Markov Chain. This is a front-end function to the discrete-time simulator. For continuous time, the PSI simulator does not allow to control the simulation horizon. The effect of "Print" is to be handled in the specific simulation function, not here. More...
 
DistributionstationaryDistribution_iterative (string method, int tmax, double precision, string initDistribType, discreteDistribution *initDistrib, bool progress)
 Multi-purpose entry point for iterative methods for approximating the stationary distribution of discrete-time Markov chains. Offers the maximal flexibility with respect to parameters, as well as the possibility to set defaults. More...
 
DistributionstationaryDistribution (bool progress)
 Entry point for methods Computing the stationary distribution of chains using the iterative method. More...
 
virtual DistributionstationaryDistributionCT (bool progress)
 Computing the stationary distribution of a CTMC using uniformization and the iterative method. More...
 
virtual DistributionstationaryDistributionCT_embedding (int tMax, double epsilon, discreteDistribution *iDis, bool progress)
 Computing the stationary distribution of a CTMC using embedding and the iterative method. More...
 
virtual DistributionstationaryDistribution_power (int tMax, double epsilon, discreteDistribution *iDis, bool progress)
 Computing the stationary distribution of a DTMC using the standard iterative power method. More...
 
void NCDProperty (double epsilon)
 Entry point for NCD command of XBORNE (Near Complete Decomposibility) More...
 
void BandIMSUB (std::string modelName="modelName")
 Entry point for BandIMSUB command of XBORNE. More...
 
void Vincent ()
 Entry point for Vincent command of XBORNE. More...
 
void RowVincent ()
 Entry point for RowVincent command of XBORNE. More...
 
void Absorbing ()
 Entry point for Absorbing command of XBORNE: computes the absorbing states of a DTMC. More...
 
void ProdFundSW (std::string modelName="modelName")
 Entry point for ProdFundSW command of XBORNE. More...
 
void RowSum (std::string modelName="modelName")
 Entry point for RowSum command of XBORNE. More...
 
DistributionstationaryDistributionGthLD ()
 Entry point for methods computing stationary distributions using the GTH method for solving the linear system. More...
 
DistributionstationaryDistributionSOR ()
 Entry point for methods computing stationary distributions using the SOR method for solving the linear system. More...
 
DistributiontransientDistributionR (int fromState, double t)
 Method for computing the transient distribution of a Markov chain. It wraps the 'solve.uc' method of the R package of L. Cerda-Alabern. More...
 
DistributiontransientDistributionDT (int fromState, int t)
 Method for computing the transient distribution of a DTMC. Uses the general method evaluateMeasure. More...
 
DistributionstationaryDistributionR ()
 Entry point for methods computing stationary distributions using the R package 'markovchain' for solving the linear system. More...
 
simulationResultsimulateChainR (double tMax, bool stats, bool traj, bool trace)
 Simulates the evolution of a discrete-time Markov Chain. Wraps the 'rmarkovchain' method of the R package 'markovchain'. More...
 
double transitionProbability (int stateFrom, int stateTo)
 Method to get the transition probabilities from some intial to some destination state. It wraps the 'transitionProbability' method of the R package 'markovchain'. More...
 
std::vector< int > absorbingStates ()
 Method that returns the list of absorbing states of the markovchain object. It wraps the 'absorbingStates()' method of the R package 'markovchain'. More...
 
std::vector< std::vector< int > > recurrentClasses ()
 Method that returns the recurrent classes of the markovchain object as a list of lists of states. It wraps the 'recurrentClasses()' method of the R package 'markovchain'. More...
 
std::vector< std::vector< int > > communicatingClasses ()
 Method that returns the communicating classes of the markovchain object as a list of lists of states. It wraps the 'communicatingClasses()' method of the R package 'markovchain'. More...
 
bool isirreducible ()
 Method verifing whether a Markov chain is irreducible. It wraps the "is.irreducible()' method of the R package 'markovchain'. More...
 
bool isaccessible (int stateFrom, int stateTo)
 Method verifying if two states communicate in a Markov chain. Wraps the 'is.accessible()' method from the R package 'markovchain'. More...
 
simulationResultstationaryDistributionSample (int nbSamples)
 Methods to sample from the stationary distribution using backwards coupling. The result is returned in a simulationResult object, but the interpretation is different: it does not represent trajectories. Here, "state" entries are the measured states, and "time" entries are the measured coupling time. More...
 
DistributionhittingTimeDistribution (int iState, bool *hitSetIndicator)
 Entry point for methods computing the distribution of the hitting time (first entry times) from some state to some set of states. More...
 
int * simulateHittingTime (int iState, bool *hittingSet, int nbSamples, int tMax)
 Obtain samples of hitting times through Monte Carlo simulation. A trajectory is simulated until it hits the target set, or its length attains a maximum, whichever comes first. Samples with the maximum are returned although they do not represent a proper hitting time. It is the responsibility of the calling party to ignore these values. More...
 
double * averageHittingTime (bool *hitSetIndicator)
 Entry point for methods computing average hitting times (first entry times) from every state to some set of states. More...
 
double * averageHittingTimeDT (bool *hitSetIndicator)
 Computing the average hitting times in a discrete-time Markov chain. Uses a direct Gauss-Seidel matrix inversion. More...
 
double * averageHittingTimeDT_iterative (bool *hitSetIndicator)
 Computing the average hitting times in a discrete-time Markov chain. Uses an iterative approximate computation. More...
 
virtual markovChaincopy ()
 copy utility More...
 
virtual markovChainuniformize ()
 Uniformize Markov Chain, by uniformizing the generator. If the chain is already discrete time, a copy is returned. More...
 
virtual markovChainembed ()
 Construct discrete-time Markov Chain obtained at transition times. If the chain is already discrete time, a copy is returned. More...
 
void setSizeType (const string path)
 Function to find out the size and the type of a Markov chain described in the MARCA format. Both quantities are directly set in the method, which returns nothing. Adapted from the method HBF::read_marka of Psi/Unix/v1.0. More...
 
int charVectorElt2State (SEXP elt, std::string function)
 Utility function to convert the element of a Rcpp::CharacterVector to a state number. More...
 
virtual void write (FILE *out, bool withReward)
 Method for writing Markov chains in a file with the ERS format. More...
 
virtual void write (string format, string modelName)
 Method for writing Markov chains in files with various formats. The ERS and R formats are supported at this time. More...
 
void write (string format)
 Method for writing Markov chains in files with various formats. This version uses the given model name. More...
 
std::string toString (std::string format)
 String serialization method for a Markov chain. More...
 

Protected Types

typedef void * RInside
 recast nonexisting RInside type to void More...
 
typedef void * SEXP
 recast nonexisting SEXP type to void More...
 

Protected Attributes

timeType _type
 time type: discrete or continuous More...
 
int _stateSpaceSize
 size of the state space (should be a pointer on the state space itself) More...
 
transitionStructure_generator
 transition structure of the chain More...
 
discreteDistribution_initDistribution
 initial distribution of the process More...
 
bool _debug
 internal debugging indicator More...
 
bool _isAbstract
 true if the object is "abstract", i.e. a pointer to some files More...
 
int _abstractNbre
 number of abstraction parameters More...
 
string * _abstract
 table of abstraction parameters More...
 
string _format
 format/language of the model More...
 
string _modelName
 name of the model More...
 

Detailed Description

Markov Chain class.

Member Typedef Documentation

typedef void* markovChain::RInside
protected

recast nonexisting RInside type to void

typedef void* markovChain::SEXP
protected

recast nonexisting SEXP type to void

Constructor & Destructor Documentation

markovChain::markovChain ( int  sz,
timeType  t 
)

Simple constructor for the Markov chain from the size.

Author
Alain Jean-Marie
Parameters
szthe size of the state space (may be infinite)
tthe type of chain: CONTINUOUS or DISCRETE
Returns
Markov Chain with no internal structures initialized
markovChain::markovChain ( transitionStructure tr)

Constructor for the Markov chain using a transition structure.

Author
Alain Jean-Marie
Parameters
trthe transition structure
Returns
Markov Chain with no internal structures initialized
markovChain::markovChain ( string  format,
string  param[],
int  nbreParam,
string  modelName,
bool  isAbstract 
)

Constructor for Markov chains from files in various formats. In the abstract form, the object just stores the name(s) of the files that define the mode. In the non-abstract (concrete) form, the chain is instantiated in the memory with a concrete transition structure. Only the ERS, PSI and Xborne formats are supported at this time for concrete chains.

Author
Issam Rabhi and Alain Jean-Marie
Parameters
formatthe format or language in which the model is specified
param[]is the list of parameters
nbreParamthe size of param
modelNamethe name of the model, usually the prefix for various files
isAbstractspecifies if the chain is abstract or not
Returns
Markov Chain
markovChain::~markovChain ( )
virtual

Standard destructor. The generator and the initial distrib are destroyed.

Author
Alain Jean-Marie

Member Function Documentation

void markovChain::Absorbing ( )

Entry point for Absorbing command of XBORNE: computes the absorbing states of a DTMC.

Author
Issam Rabhi
Returns
void but Absorbing may create modelName.part if any absorbing nodes are found
std::vector< int > markovChain::absorbingStates ( )

Method that returns the list of absorbing states of the markovchain object. It wraps the 'absorbingStates()' method of the R package 'markovchain'.

Author
Issam Rabhi
Returns
a vector of indices of states
void markovChain::abstract ( )
inline

Utility to display the value of the table _abstract[].

Author
Issam Rabhi
int markovChain::abstractNbre ( )
inline

Utility to get _abstractNbre.

Author
Issam Rabhi
Returns
_abstractNbre which is the length of the table containing names related to the model.
double * markovChain::averageHittingTime ( bool *  hitSetIndicator)

Entry point for methods computing average hitting times (first entry times) from every state to some set of states.

Author
Alain Jean-Marie
Parameters
hitSetIndicatora boolean array where states in the hitting set are marked with true
Returns
the array of average hitting times from every state not in the hitting set
double * markovChain::averageHittingTimeDT ( bool *  hitSetIndicator)

Computing the average hitting times in a discrete-time Markov chain. Uses a direct Gauss-Seidel matrix inversion.

Author
Alain Jean-Marie
Parameters
hitSetIndicatora boolean array where states in the hitting set are marked with true
Returns
the array of average hitting times from every state not in the hitting set
double * markovChain::averageHittingTimeDT_iterative ( bool *  hitSetIndicator)

Computing the average hitting times in a discrete-time Markov chain. Uses an iterative approximate computation.

Author
Alain Jean-Marie
Parameters
hitSetIndicatora boolean array where states in the hitting set are marked with true
Returns
the array of average hitting times from every state not in the hitting set
void markovChain::BandIMSUB ( std::string  modelName = "modelName")

Entry point for BandIMSUB command of XBORNE.

Author
Issam Rabhi
Returns
void but BandIMSUB create modelName.I.U.sz and modelName.I.U.Rii files
int markovChain::charVectorElt2State ( SEXP  elt,
std::string  function 
)

Utility function to convert the element of a Rcpp::CharacterVector to a state number.

Parameters
eltthe element to be converted
functionthe name of the function where the call occurs, for tracing
Returns
the state index
std::vector< std::vector< int > > markovChain::communicatingClasses ( )

Method that returns the communicating classes of the markovchain object as a list of lists of states. It wraps the 'communicatingClasses()' method of the R package 'markovchain'.

Author
Issam Rabhi
Returns
a vector of vectors of indices of states
markovChain * markovChain::copy ( )
virtual

copy utility

Copy a Markov Chain, including the generator and the initial distribution.

Returns
markovChain
Author
Alain Jean-Marie
Returns
a new Markov chain, uniformized version of the original
markovChain * markovChain::embed ( )
virtual

Construct discrete-time Markov Chain obtained at transition times. If the chain is already discrete time, a copy is returned.

Author
Alain Jean-Marie
Returns
a new Markov chain, embedded at transition times
string markovChain::format ( )
inline

Utility to get _format.

Author
Issam Rabhi
Returns
_format which is the format of the Markov Chain (XbornePres, Xborne, mcl, ...)
transitionStructure* markovChain::generator ( )
inline

Read accessor to get the value of _generator which is a transitionStructure.

Returns
the transition structure
Distribution* markovChain::hittingTimeDistribution ( int  iState,
bool *  hitSetIndicator 
)

Entry point for methods computing the distribution of the hitting time (first entry times) from some state to some set of states.

Author
Alain Jean-Marie
Parameters
iStateindex of the initial state
hitSetIndicatora boolean array where states in the hitting set are marked with true
Returns
the array of average hitting times from every state not in the hitting set
bool markovChain::isaccessible ( int  stateFrom,
int  stateTo 
)

Method verifying if two states communicate in a Markov chain. Wraps the 'is.accessible()' method from the R package 'markovchain'.

Author
Issam Rabhi
Parameters
stateFromindex of the origin state
stateToindex of the destination state
Returns
true if a path exists from origin to destination, false otherwise
bool markovChain::isirreducible ( )

Method verifing whether a Markov chain is irreducible. It wraps the "is.irreducible()' method of the R package 'markovchain'.

Author
Issam Rabhi
Returns
true if the chain is irreducible, false otherwise
string markovChain::modelName ( )
inline

Utility to get _modelName.

Author
Issam Rabhi
Returns
_modelName which is the model name.
void markovChain::NCDProperty ( double  epsilon)

Entry point for NCD command of XBORNE (Near Complete Decomposibility)

Author
Issam Rabhi
Parameters
epsilonthreshold for detecting decomposability
Returns
void but files are created: modelName.NCD.suffix.part and modelName.NCD.suffix.eps
void markovChain::ProdFundSW ( std::string  modelName = "modelName")

Entry point for ProdFundSW command of XBORNE.

Author
Issam Rabhi
Returns
void but ProdFundSW create 5 files: modelName.abs.SW.Cii modelName.abs.SW.sz modelName.FUND.SE.Rii modelName.FUND.SE.sz modelName.RwdP
Distribution * markovChain::read ( )

Method(s) for deserializing Distribution from Xborne file (.pi).

Author
Issam Rabhi
Returns
Distribution
std::vector< std::vector< int > > markovChain::recurrentClasses ( )

Method that returns the recurrent classes of the markovchain object as a list of lists of states. It wraps the 'recurrentClasses()' method of the R package 'markovchain'.

Author
Issam Rabhi
Returns
a vector of vectors of indices of states
RInside * markovChain::Rmotor ( )

Read accessor to the embedded R engine, a static variable named _Rmotor. When accessed for the first time, an instance of RInside is created.

Returns
a pointer to the R execution engine
void markovChain::RowSum ( std::string  modelName = "modelName")

Entry point for RowSum command of XBORNE.

Author
Issam Rabhi
Returns
void but RowSum create modelName.rwdT file
void markovChain::RowVincent ( )

Entry point for RowVincent command of XBORNE.

Author
Issam Rabhi
Returns
void but RowVincent creates files modelName.V.U.sz and modelName.V.U.Rii
void markovChain::setAbstract ( string  abstract[])

Utility to set the value of the table containing names related to the model: file names, extensions etc.

Author
Issam Rabhi and Alain Jean-Marie
Parameters
abstracttable with the strings to be copied to _abstract
void markovChain::setAbstractNbre ( int  abstractNbre)
inline

Utility to set the value of _abstractNbre.

Parameters
abstractNbrethe number of abstract parameters to be set
void markovChain::setFormat ( string  format)
inline

Utility to set the value of _format.

Parameters
format
void markovChain::setGenerator ( transitionStructure tr)
inline

Write accessor to set the value of _generator which is a transitionStructure.

Parameters
trthe transition structure to be set
void markovChain::setInitDistribution ( discreteDistribution d)
inline

Write accessor to set the value of _initDistribution which is a discreteDistribution.

Parameters
dthe distribution to be set
void markovChain::setModelName ( string  modelName)
inline

Utility to set the value of _modelName.

Parameters
modelName
void markovChain::setSizeType ( const string  path)

Function to find out the size and the type of a Markov chain described in the MARCA format. Both quantities are directly set in the method, which returns nothing. Adapted from the method HBF::read_marka of Psi/Unix/v1.0.

Author
Alain Jean-Marie
simulationResult * markovChain::simulateChain ( double  tMax,
bool  Stats,
bool  Traj,
bool  withIncrements,
bool  Print 
)
virtual

Simulates the evolution of a Markov Chain using the PSI program. This is a front-end function to both discrete-time and the continuous-time simulators.

Author
Alain Jean-Marie and Issam Rabhi
Parameters
tMaxtime until which the Markov chain is simulated
Statsindicates whether occupancy statistics are collected and returned
Trajindicates whether a trajectory is returned
withIncrementsindicates whether time increments should be produced
Printindicates whether values should be printed along the way
Returns
a structure with the results of the simulation

Reimplemented in homogeneous1DBirthDeath, and felsenstein81.

simulationResult * markovChain::simulateChainCT ( double  tMax,
bool  stats,
bool  traj,
bool  withIncrements,
bool  trace 
)
virtual

Simulates the evolution of a continuous-time Markov Chain.

Author
Alain Jean-Marie and Issam Rabhi
Parameters
tMaxtime until which the Markov chain is simulated
statsindicates whether occupancy statistics are collected and returned
trajindicates whether a trajectory is returned
withIncrementsindicates whether time increments should be printed
traceindicates whether the trajectory should be printed along the way (on stdout)
Returns
a structure with the results of the simulation
simulationResult * markovChain::simulateChainDT ( int  tMax,
bool  stats,
bool  traj,
bool  trace 
)
virtual

Simulates the evolution of a discrete-time Markov Chain.

Author
Alain Jean-Marie and Issam Rabhi
Parameters
tMaxtime until which the Markov chain is simulated
statsindicates whether occupancy statistics are collected and returned
trajindicates whether a trajectory is returned
traceindicates whether the trajectory should be printed along the way (on stdout)
Returns
a structure with the results of the simulation
simulationResult * markovChain::simulateChainR ( double  tMax,
bool  stats,
bool  traj,
bool  trace 
)

Simulates the evolution of a discrete-time Markov Chain. Wraps the 'rmarkovchain' method of the R package 'markovchain'.

Author
Issam Rabhi
Parameters
tMaxtime until which the Markov chain is simulated
statsindicates whether occupancy statistics are collected and returned
trajindicates whether a trajectory is returned
traceindicates whether the trajectory should be printed along the way (on stdout)
Returns
a structure with the results of the simulation
int * markovChain::simulateHittingTime ( int  iState,
bool *  hittingSet,
int  nbSamples,
int  tMax 
)

Obtain samples of hitting times through Monte Carlo simulation. A trajectory is simulated until it hits the target set, or its length attains a maximum, whichever comes first. Samples with the maximum are returned although they do not represent a proper hitting time. It is the responsibility of the calling party to ignore these values.

Parameters
iStatethe initial state from which trajectories start
hittingSetboolean array indicating with true which states are in the target
nbSamplesnumber of samples to collect
tMaxmaximum length of trajectories
Returns
an array with the samples
simulationResult * markovChain::simulatePSI ( int  tMax,
bool  stats,
bool  Traj,
bool  Print 
)

Simulates the evolution of a Markov Chain. This is a front-end function to the discrete-time simulator. For continuous time, the PSI simulator does not allow to control the simulation horizon. The effect of "Print" is to be handled in the specific simulation function, not here.

Author
Alain Jean-Marie and Issam Rabhi
Parameters
tMaxtime until which the Markov chain is simulated
statsindicates whether occupancy statistics are collected and returned
Trajindicates whether a trajectory is returned
Printindicates whether values should be printed along the way
Returns
a structure with the results of the simulation
int markovChain::stateSpaceSize ( )
inline

Read accessor to get the number of states in the state space of the Markov chain.

Returns
the size of the state space
Distribution * markovChain::stationaryDistribution ( bool  progress)

Entry point for methods Computing the stationary distribution of chains using the iterative method.

Author
Alain Jean-Marie
Parameters
progressindicates whether the progress of the iterative method should be displayed
Returns
an approximation of the stationary distribution
Distribution * markovChain::stationaryDistribution_iterative ( string  method,
int  tmax,
double  precision,
string  initDistribType,
discreteDistribution initDistrib,
bool  progress 
)

Multi-purpose entry point for iterative methods for approximating the stationary distribution of discrete-time Markov chains. Offers the maximal flexibility with respect to parameters, as well as the possibility to set defaults.

Parameters
methoda string describing the method to be called. Possibilities are "Power", "SOR".
tmaxmaximal number of iterations; defaults to 1000 if set to 0
precisionprecision parameter for stopping rules; defaults to 1e-7 if set to 0
initDistribTypea string describing the initial distribution to be used in iterations. Possibilities are "Zero", "Max", "Uniform", "Custom".
initDistriba distribution object in the case of "Custom" initial distribution.
progressboolean indicator for tracing the progression
Returns
Distribution * markovChain::stationaryDistribution_power ( int  tMax,
double  epsilon,
discreteDistribution iDis,
bool  progress 
)
virtual

Computing the stationary distribution of a DTMC using the standard iterative power method.

Author
Alain Jean-Marie and Issam Rabhi
Parameters
tMaxmaximal number of iterations
epsilonprecision parameter for the stopping rule
iDisinitial distribution to be used
progressindicates whether the progress of the iterative method should be displayed
Returns
an approximation of the stationary distribution
Distribution * markovChain::stationaryDistributionCT ( bool  progress)
virtual

Computing the stationary distribution of a CTMC using uniformization and the iterative method.

Author
Alain Jean-Marie
Parameters
progressindicates whether the progress of the iterative method should be displayed
Returns
an approximation of the stationary distribution
Distribution * markovChain::stationaryDistributionCT_embedding ( int  tMax,
double  epsilon,
discreteDistribution iDis,
bool  progress 
)
virtual

Computing the stationary distribution of a CTMC using embedding and the iterative method.

Author
Alain Jean-Marie
Parameters
tMaxmaximal number of iterations
epsilonprecision parameter for the stopping rule
iDisinitial distribution to be used
progressindicates whether the progress of the iterative method should be displayed
Returns
an approximation of the stationary distribution
Distribution * markovChain::stationaryDistributionGthLD ( )

Entry point for methods computing stationary distributions using the GTH method for solving the linear system.

Author
Issam Rabhi and Alain Jean-Marie
Returns
the stationary distribution, up to errors in the solution of the linear system
Distribution * markovChain::stationaryDistributionR ( )

Entry point for methods computing stationary distributions using the R package 'markovchain' for solving the linear system.

Author
Issam Rabhi
Returns
the stationary distribution, up to errors in the solution of the linear system
simulationResult * markovChain::stationaryDistributionSample ( int  nbSamples)

Methods to sample from the stationary distribution using backwards coupling. The result is returned in a simulationResult object, but the interpretation is different: it does not represent trajectories. Here, "state" entries are the measured states, and "time" entries are the measured coupling time.

Author
Alain Jean-Marie
Parameters
nbSamplesnumber of samples to collect
Returns
an object storing the measured samples and coupling times
Distribution * markovChain::stationaryDistributionSOR ( )

Entry point for methods computing stationary distributions using the SOR method for solving the linear system.

Author
Alain Jean-Marie
Returns
the stationary distribution, up to errors in the solution of the linear system
std::string markovChain::toString ( std::string  format)

String serialization method for a Markov chain.

Author
Issam Rabhi (R language)
Parameters
formatthe format/language to be used.
Distribution * markovChain::transientDistributionDT ( int  fromState,
int  t 
)

Method for computing the transient distribution of a DTMC. Uses the general method evaluateMeasure.

Author
Alain Jean-Marie
Returns
the transient distribution, up to numerical errors
Distribution * markovChain::transientDistributionR ( int  fromState,
double  t 
)

Method for computing the transient distribution of a Markov chain. It wraps the 'solve.uc' method of the R package of L. Cerda-Alabern.

Author
Alain Jean-Marie
Returns
the transient distribution, up to numerical errors
double markovChain::transitionProbability ( int  stateFrom,
int  stateTo 
)

Method to get the transition probabilities from some intial to some destination state. It wraps the 'transitionProbability' method of the R package 'markovchain'.

Author
Issam Rabhi
Returns
a probability
markovChain * markovChain::uniformize ( )
virtual

Uniformize Markov Chain, by uniformizing the generator. If the chain is already discrete time, a copy is returned.

Author
Alain Jean-Marie
Returns
a new Markov chain, uniformized version of the original
void markovChain::Vincent ( )

Entry point for Vincent command of XBORNE.

Author
Issam Rabhi
Returns
void but Vincent creates 4 files: modelName.V.[UL].sz, modelName.V.U.Rii and modelName.V.L.Rdi files
void markovChain::write ( FILE *  out,
bool  withReward 
)
virtual

Method for writing Markov chains in a file with the ERS format.

Author
Alain Jean-Marie
Parameters
outthe file descriptor in which to write the chain
withRewardspecifies if rewards are to be written; not used yet
void markovChain::write ( string  format,
string  modelName 
)
virtual

Method for writing Markov chains in files with various formats. The ERS and R formats are supported at this time.

Author
Alain Jean-Marie
Parameters
formata string describing the format
modelNamea string for naming the model, usually used for file name prefixes

Reimplemented in homogeneous1DRandomWalk.

void markovChain::write ( string  format)
inline

Method for writing Markov chains in files with various formats. This version uses the given model name.

Author
Alain Jean-Marie
Parameters
formata string describing the format

Member Data Documentation

string* markovChain::_abstract
protected

table of abstraction parameters

int markovChain::_abstractNbre
protected

number of abstraction parameters

bool markovChain::_debug
protected

internal debugging indicator

string markovChain::_format
protected

format/language of the model

transitionStructure* markovChain::_generator
protected

transition structure of the chain

discreteDistribution* markovChain::_initDistribution
protected

initial distribution of the process

bool markovChain::_isAbstract
protected

true if the object is "abstract", i.e. a pointer to some files

string markovChain::_modelName
protected

name of the model

int markovChain::_stateSpaceSize
protected

size of the state space (should be a pointer on the state space itself)

timeType markovChain::_type
protected

time type: discrete or continuous


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