![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| struct | MarkovChainModel |
| A user-supplied chain: a MarkovProcess when discrete is false, else a MarkovChain. More... | |
| struct | ProbStateResult |
| What getProbState returns: the probability and the two determinants behind it. More... | |
| struct | TransientAtResult |
| What the CTMC transient returns: the law at t and the truncation it used. More... | |
| struct | TimeAverageOut |
| What timeAverage returns. More... | |
| struct | AggregateResult |
| What aggregate returns: the approximate law and the two NCD indices. More... | |
| struct | StochCompOut |
| What stochCompFull returns for a CTMC; a DTMC fills the same blocks from P. More... | |
| struct | ChainPath |
| A sampled path: the states visited, with their holding times for a CTMC. More... | |
Functions | |
| template<class T> | |
| MarkovChainModel< T > | to_markov_process (const MarkovChainModel< T > &m) |
| MarkovChain.toMarkovProcess / toCTMC: read the DTMC as a CTMC with unit exit rates, Q = P - I. | |
| template<class T> | |
| T | default_uniformization_rate (const Matrix< T > &Q) |
| The uniformization rate this port uses when the caller names none. | |
| template<class T> | |
| MarkovChainModel< T > | to_markov_chain (const MarkovChainModel< T > &m, const T &q) |
| MarkovProcess.toMarkovChain / toDTMC: the UNIFORMIZED chain, P = Q/q + I. | |
| template<class T> | |
| MarkovChainModel< T > | to_markov_chain (const MarkovChainModel< T > &m) |
| template<class T> | |
| MarkovChainModel< T > | to_dtmc (const MarkovChainModel< T > &m) |
| toDTMC, the backwards-compatible alias of toMarkovChain. | |
| template<class T> | |
| MarkovChainModel< T > | to_dtmc (const MarkovChainModel< T > &m, const T &q) |
| template<class T> | |
| MarkovChainModel< T > | to_embedded (const MarkovChainModel< T > &m) |
| MarkovProcess.toEmbedded: the JUMP CHAIN, the DTMC of the states visited at transition epochs. | |
| template<class T> | |
| MarkovChainModel< T > | to_time_reversed (const MarkovChainModel< T > &m) |
| toTimeReversed for either kind: the chain run backwards in time. | |
| template<class T> | |
| std::vector< T > | chain_solve (const MarkovChainModel< T > &m) |
| MarkovProcess.solve / MarkovChain.solve. | |
| template<class T> | |
| std::vector< T > | solve_relative (const MarkovChainModel< T > &m, std::size_t refstate=0) |
| MarkovProcess.solveRelative: the equilibrium vector normalized so that refstate carries one, which exists even where the normalizing constant does not. | |
| template<class T> | |
| ProbStateResult< T > | get_prob_state (const MarkovChainModel< T > &m, std::size_t i) |
| MarkovProcess.getProbState: the probability of ONE state by Cramer's rule. | |
| template<class T> | |
| std::size_t | match_state (const MarkovChainModel< T > &m, const std::vector< T > &state) |
| Row index of state in the chain's state space, or n when it carries none. | |
| template<class T> | |
| ProbStateResult< T > | get_prob_state (const MarkovChainModel< T > &m, const std::vector< T > &state) |
| getProbState addressed by the state itself rather than by its index. | |
| template<class T> | |
| bool | is_feasible (const MarkovChainModel< T > &m) |
| isFeasible: a valid generator, or a stochastic transition matrix. | |
| template<class T> | |
| TransientAtResult< T > | chain_transient_at (const MarkovChainModel< T > &m, const std::vector< T > &pi0in, const T &t, const std::string &method="unif") |
| MarkovProcess.transient: the law at ONE time t, by uniformization. | |
| template<class T> | |
| Matrix< T > | chain_transient_steps (const MarkovChainModel< T > &m, const std::vector< T > &pi0in, std::size_t steps=1) |
| MarkovChain.transient: the law at every step 0..steps, one row per step. | |
| template<class T> | |
| TransientAtResult< T > | chain_transient_unif (const MarkovChainModel< T > &m, const std::vector< T > &pi0in, const T &t) |
| MarkovChain.transientUnif: the DTMC read as the randomized image of a CTMC, so t is CONTINUOUS here where chain_transient_steps counts steps. | |
| template<class T> | |
| TimeAverageOut< T > | time_average (const MarkovChainModel< T > &m, const std::vector< T > &pi0in, const T &t) |
| MarkovProcess.timeAverage: the law averaged over [0,t], and its endpoint. | |
| template<class T> | |
| std::vector< T > | chain_sens (const MarkovChainModel< T > &m, const Matrix< T > &dQ) |
| MarkovProcess.sens: the derivative of the stationary law with respect to a scalar parameter, given the derivative dQ of the generator. | |
| template<class T> | |
| AggregateResult< T > | aggregate (const MarkovChainModel< T > &m, const std::vector< std::vector< std::size_t > > &MS, const std::string &method="courtois", const T *param=nullptr) |
| MarkovProcess.aggregate: aggregation-disaggregation over a macrostate partition. | |
| template<class T> | |
| AggregateResult< T > | aggregate_multi (const MarkovChainModel< T > &m, const std::vector< std::vector< std::size_t > > &MS, const std::vector< std::vector< std::size_t > > &MSS) |
| The "multi" arm of aggregate, separated because its parameter is a PARTITION OF THE PARTITION and not a scalar. | |
| template<class T> | |
| StochCompOut< T > | stoch_comp_full (const MarkovChainModel< T > &m, const std::vector< std::size_t > &I=std::vector< std::size_t >()) |
| stochComp / stochCompFull for either kind. | |
| template<class T> | |
| Matrix< T > | stoch_comp (const MarkovChainModel< T > &m, const std::vector< std::size_t > &I=std::vector< std::size_t >()) |
| stochComp: the complement alone. | |
| template<class T> | |
| std::vector< T > | hitting_time (const MarkovChainModel< T > &m, const std::vector< std::size_t > &target) |
| hittingTime: the mean time (CTMC) or step count (DTMC) to reach any state in target, zero on the target set itself and infinite from a state that cannot reach it. | |
| template<class T, class Gen> | |
| ChainPath< T > | chain_sample (const MarkovChainModel< T > &m, const std::vector< T > &pi0in, std::size_t n, Gen &gen) |
| sample: simulate n steps. | |
| template<class T, class Gen> | |
| MarkovChainModel< T > | rand_process (std::size_t n, Gen &gen) |
| MarkovProcess.rand: a random generator of the given order. | |
| template<class T, class Gen> | |
| MarkovChainModel< T > | rand_chain (std::size_t n, Gen &gen) |
| MarkovChain.rand: a random transition matrix of the given order. | |
| template<class T> | |
| MarkovChainModel< T > | from_sample_sys_aggr (const Matrix< T > &sample_state) |
| MarkovChain.fromSampleSysAggr: estimate a DTMC from an observed trajectory. | |
| AggregateResult< T > line::lang::processes::aggregate | ( | const MarkovChainModel< T > & | m, |
| const std::vector< std::vector< std::size_t > > & | MS, | ||
| const std::string & | method = "courtois", | ||
| const T * | param = nullptr ) |
MarkovProcess.aggregate: aggregation-disaggregation over a macrostate partition.
method is "courtois" (the default; param is the randomization rate q), "kms" or "takahashi" (param is the sweep count, default 10), or "multi", which needs the SECOND-LEVEL partition and therefore does not go through param at all – it is refused here without MSS, as the reference refuses it.
READ eps BEFORE THE ANSWER. These are approximations whose error is governed by how nearly decomposable the partition is; eps > epsMAX means the partition does not justify the method, and the vector is returned anyway because the reference returns it. It is a diagnostic, not a gate.
MS is 0-based here and 1-based in the reference.
Definition at line 527 of file markov_chain.h.
References aggregate(), line::mc::ctmc_courtois(), line::mc::ctmc_kms(), line::mc::ctmc_takahashi(), line::lang::processes::AggregateResult< T >::eps, line::mc::CourtoisResult< T >::eps, line::mc::KmsResult< T >::eps, line::mc::TakahashiResult< T >::eps, line::lang::processes::AggregateResult< T >::epsMAX, line::mc::CourtoisResult< T >::epsMAX, line::mc::KmsResult< T >::epsMAX, line::mc::TakahashiResult< T >::epsMAX, line::InputError::InputError(), line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::AggregateResult< T >::p, line::mc::CourtoisResult< T >::p, line::mc::KmsResult< T >::p, and line::mc::TakahashiResult< T >::p.
Referenced by aggregate().
| AggregateResult< T > line::lang::processes::aggregate_multi | ( | const MarkovChainModel< T > & | m, |
| const std::vector< std::vector< std::size_t > > & | MS, | ||
| const std::vector< std::vector< std::size_t > > & | MSS ) |
The "multi" arm of aggregate, separated because its parameter is a PARTITION OF THE PARTITION and not a scalar.
MSS partitions the macrostate indices 0..|MS|-1.
Definition at line 572 of file markov_chain.h.
References aggregate_multi(), line::mc::ctmc_multi(), line::lang::processes::AggregateResult< T >::eps, line::mc::MultiResult< T >::eps, line::lang::processes::AggregateResult< T >::epsMAX, line::mc::MultiResult< T >::epsMAX, line::InputError::InputError(), line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::AggregateResult< T >::p, and line::mc::MultiResult< T >::p.
Referenced by aggregate_multi().
| ChainPath< T > line::lang::processes::chain_sample | ( | const MarkovChainModel< T > & | m, |
| const std::vector< T > & | pi0in, | ||
| std::size_t | n, | ||
| Gen & | gen ) |
sample: simulate n steps.
The reference draws the initial state from a uniform law it randomizes itself (MarkovChain.sample) or from the primitive's default (MarkovProcess). Here pi0 is explicit and empty reproduces that default, so a caller can make the path reproducible by naming the law and seeding gen.
Definition at line 683 of file markov_chain.h.
References chain_sample(), line::mc::ctmc_simulate(), line::lang::processes::MarkovChainModel< T >::discrete, line::mc::dtmc_simulate(), line::InputError::InputError(), line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::ChainPath< T >::sojourn, line::mc::CtmcPath< T >::sojourn, line::lang::processes::ChainPath< T >::states, and line::mc::CtmcPath< T >::states.
Referenced by chain_sample().
| std::vector< T > line::lang::processes::chain_sens | ( | const MarkovChainModel< T > & | m, |
| const Matrix< T > & | dQ ) |
MarkovProcess.sens: the derivative of the stationary law with respect to a scalar parameter, given the derivative dQ of the generator.
The reference feeds it its own solve(), so this one does too.
Definition at line 491 of file markov_chain.h.
References chain_sens(), chain_solve(), line::mc::ctmc_sens(), and line::lang::processes::MarkovChainModel< T >::mat.
Referenced by chain_sens().
| std::vector< T > line::lang::processes::chain_solve | ( | const MarkovChainModel< T > & | m | ) |
MarkovProcess.solve / MarkovChain.solve.
THE REDUCIBLE SOLVER IS THE NUMERIC PATH IN BOTH CLASSES, not a fallback: the reference reserves the plain ctmc_solve / dtmc_solve for a SYMBOLIC matrix, where the reducible variant's component decomposition has nothing to decide. This port has no symbolic element type, so the reducible one is what every call takes. solver_ctmc_chain in solvers/ctmc deliberately does the other thing – primary first, reducible on a failed validity test – because it ports solver_ctmc_chain.m, not the class method, and those two disagree.
Definition at line 283 of file markov_chain.h.
References chain_solve(), line::mc::ctmc_solve_reducible(), line::lang::processes::MarkovChainModel< T >::discrete, line::mc::dtmc_solve_reducible(), and line::lang::processes::MarkovChainModel< T >::mat.
Referenced by chain_sens(), and chain_solve().
| TransientAtResult< T > line::lang::processes::chain_transient_at | ( | const MarkovChainModel< T > & | m, |
| const std::vector< T > & | pi0in, | ||
| const T & | t, | ||
| const std::string & | method = "unif" ) |
MarkovProcess.transient: the law at ONE time t, by uniformization.
method is "unif" (Jensen, the default) or "foxglynn", whose weights are built by the Fox-Glynn recursion instead of by evaluating Poisson terms, so it survives a q t large enough to underflow them. Note that t is a TIME here; the DTMC counterpart takes a step count, which is why the two are separate functions rather than one dispatching on discrete.
Definition at line 403 of file markov_chain.h.
References chain_transient_at(), line::mc::ctmc_foxglynn(), line::mc::ctmc_uniformization(), line::InputError::InputError(), line::lang::processes::TransientAtResult< T >::kmax, line::mc::UniformizationResult< T >::kmax, line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::TransientAtResult< T >::pi, line::mc::FoxGlynnResult< T >::pi, line::mc::UniformizationResult< T >::pi, and line::mc::FoxGlynnResult< T >::right.
Referenced by chain_transient_at().
| Matrix< T > line::lang::processes::chain_transient_steps | ( | const MarkovChainModel< T > & | m, |
| const std::vector< T > & | pi0in, | ||
| std::size_t | steps = 1 ) |
MarkovChain.transient: the law at every step 0..steps, one row per step.
The DTMC's clock is the step count, so unlike the CTMC method this returns the whole trajectory and takes no time argument.
Definition at line 433 of file markov_chain.h.
References chain_transient_steps(), line::mc::dtmc_transient(), and line::lang::processes::MarkovChainModel< T >::mat.
Referenced by chain_transient_steps().
| TransientAtResult< T > line::lang::processes::chain_transient_unif | ( | const MarkovChainModel< T > & | m, |
| const std::vector< T > & | pi0in, | ||
| const T & | t ) |
MarkovChain.transientUnif: the DTMC read as the randomized image of a CTMC, so t is CONTINUOUS here where chain_transient_steps counts steps.
The two answer different questions about the same matrix and the reference keeps both.
Definition at line 448 of file markov_chain.h.
References chain_transient_unif(), line::mc::dtmc_uniformization(), line::lang::processes::TransientAtResult< T >::kmax, line::mc::UniformizationResult< T >::kmax, line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::TransientAtResult< T >::pi, and line::mc::UniformizationResult< T >::pi.
Referenced by chain_transient_unif().
| T line::lang::processes::default_uniformization_rate | ( | const Matrix< T > & | Q | ) |
The uniformization rate this port uses when the caller names none.
Definition at line 176 of file markov_chain.h.
References default_uniformization_rate(), line::num_abs(), and line::Matrix< T >::rows().
Referenced by default_uniformization_rate(), and to_markov_chain().
| MarkovChainModel< T > line::lang::processes::from_sample_sys_aggr | ( | const Matrix< T > & | sample_state | ) |
MarkovChain.fromSampleSysAggr: estimate a DTMC from an observed trajectory.
sample_state holds one row per observation, the columns being the aggregate state; the reference joins the per-node trajectories COLUMN-WISE first, which is time alignment, so a caller must pass the joined matrix. Distinct rows become the state space in first-appearance order, transition counts between consecutive observations become the matrix, and dtmc_makestochastic normalizes it.
FIRST-APPEARANCE ORDER, NOT SORTED ORDER, is a deliberate departure: MATLAB's unique(...,'rows') sorts, and reproducing a lexicographic sort over rows of an arbitrary element type would be a second, unstated, definition of order. The estimated chain is the same up to the permutation, and state_space carries the labelling, so a caller reading the two together is unaffected. A caller comparing raw matrix entries against MATLAB is, and should permute.
Definition at line 754 of file markov_chain.h.
References line::lang::processes::MarkovChainModel< T >::chain(), line::Matrix< T >::cols(), from_sample_sys_aggr(), line::InputError::InputError(), and line::Matrix< T >::rows().
Referenced by from_sample_sys_aggr().
| ProbStateResult< T > line::lang::processes::get_prob_state | ( | const MarkovChainModel< T > & | m, |
| const std::vector< T > & | state ) |
getProbState addressed by the state itself rather than by its index.
Definition at line 367 of file markov_chain.h.
References get_prob_state(), line::InputError::InputError(), match_state(), and line::lang::processes::MarkovChainModel< T >::state_space.
| ProbStateResult< T > line::lang::processes::get_prob_state | ( | const MarkovChainModel< T > & | m, |
| std::size_t | i ) |
MarkovProcess.getProbState: the probability of ONE state by Cramer's rule.
Column 0 of the generator is replaced by ones, which imposes the normalization in place of the column the balance equations make redundant; the numerator matrix additionally zeroes row i and puts a one back in its first entry. The quotient of the two determinants is the probability.
WHY A DETERMINANT AND NOT A SOLVE. This exists so that the probability of one state can be written as a RATIO OF POLYNOMIALS in the generator's entries, which is what makes it useful symbolically in the reference. Numerically a full solve is cheaper and better conditioned, and chain_solve is that; this one is kept faithful because a caller reaching for it wants num and den separately.
Definition at line 325 of file markov_chain.h.
References line::lang::processes::ProbStateResult< T >::den, get_prob_state(), line::InputError::InputError(), line::lu_det(), line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::ProbStateResult< T >::num, line::NumericError::NumericError(), and line::lang::processes::ProbStateResult< T >::pi_i.
Referenced by get_prob_state(), and get_prob_state().
| std::vector< T > line::lang::processes::hitting_time | ( | const MarkovChainModel< T > & | m, |
| const std::vector< std::size_t > & | target ) |
hittingTime: the mean time (CTMC) or step count (DTMC) to reach any state in target, zero on the target set itself and infinite from a state that cannot reach it.
target is 0-based here and 1-based in the reference.
Definition at line 659 of file markov_chain.h.
References line::mc::ctmc_hitting_time(), line::lang::processes::MarkovChainModel< T >::discrete, line::mc::dtmc_hitting_time(), hitting_time(), line::InputError::InputError(), and line::lang::processes::MarkovChainModel< T >::mat.
Referenced by hitting_time().
| bool line::lang::processes::is_feasible | ( | const MarkovChainModel< T > & | m | ) |
isFeasible: a valid generator, or a stochastic transition matrix.
Definition at line 376 of file markov_chain.h.
References line::mc::ctmc_isfeasible(), line::lang::processes::MarkovChainModel< T >::discrete, line::mc::dtmc_isfeasible(), is_feasible(), and line::lang::processes::MarkovChainModel< T >::mat.
Referenced by is_feasible().
| std::size_t line::lang::processes::match_state | ( | const MarkovChainModel< T > & | m, |
| const std::vector< T > & | state ) |
Row index of state in the chain's state space, or n when it carries none.
Definition at line 351 of file markov_chain.h.
References line::InputError::InputError(), match_state(), and line::lang::processes::MarkovChainModel< T >::state_space.
Referenced by get_prob_state(), and match_state().
| MarkovChainModel< T > line::lang::processes::rand_chain | ( | std::size_t | n, |
| Gen & | gen ) |
MarkovChain.rand: a random transition matrix of the given order.
Definition at line 730 of file markov_chain.h.
References line::lang::processes::MarkovChainModel< T >::chain(), line::mc::dtmc_rand(), and rand_chain().
Referenced by rand_chain().
| MarkovChainModel< T > line::lang::processes::rand_process | ( | std::size_t | n, |
| Gen & | gen ) |
MarkovProcess.rand: a random generator of the given order.
Definition at line 722 of file markov_chain.h.
References line::mc::ctmc_rand(), line::lang::processes::MarkovChainModel< T >::process(), and rand_process().
Referenced by rand_process().
| std::vector< T > line::lang::processes::solve_relative | ( | const MarkovChainModel< T > & | m, |
| std::size_t | refstate = 0 ) |
MarkovProcess.solveRelative: the equilibrium vector normalized so that refstate carries one, which exists even where the normalizing constant does not.
refstate is 0-based here and 1-based in the reference.
Definition at line 295 of file markov_chain.h.
References line::mc::ctmc_relsolve(), line::lang::processes::MarkovChainModel< T >::mat, and solve_relative().
Referenced by solve_relative().
| Matrix< T > line::lang::processes::stoch_comp | ( | const MarkovChainModel< T > & | m, |
| const std::vector< std::size_t > & | I = std::vector<std::size_t>() ) |
stochComp: the complement alone.
Definition at line 644 of file markov_chain.h.
References stoch_comp(), and stoch_comp_full().
Referenced by stoch_comp().
| StochCompOut< T > line::lang::processes::stoch_comp_full | ( | const MarkovChainModel< T > & | m, |
| const std::vector< std::size_t > & | I = std::vector<std::size_t>() ) |
stochComp / stochCompFull for either kind.
I is 0-based here and 1-based in the reference. An empty I takes the reference's own default, the first half of the state space.
THE DTMC ARM FILLS ONLY S. dtmc_stochcomp returns the complement alone, as MarkovChain.stochCompFull reports blocks its own primitive does not separate; the four blocks are left empty rather than reconstructed here, which would be a different function under the same name.
Definition at line 614 of file markov_chain.h.
References line::lang::processes::StochCompOut< T >::A11, line::lang::processes::StochCompOut< T >::A12, line::lang::processes::StochCompOut< T >::A21, line::lang::processes::StochCompOut< T >::A22, line::mc::ctmc_stochcomp(), line::lang::processes::MarkovChainModel< T >::discrete, line::mc::dtmc_stochcomp(), line::InputError::InputError(), line::lang::processes::MarkovChainModel< T >::mat, line::mc::StochCompResult< T >::Q11, line::mc::StochCompResult< T >::Q12, line::mc::StochCompResult< T >::Q21, line::mc::StochCompResult< T >::Q22, line::lang::processes::StochCompOut< T >::S, line::mc::StochCompResult< T >::S, stoch_comp_full(), line::lang::processes::StochCompOut< T >::T12, and line::mc::StochCompResult< T >::T12.
Referenced by stoch_comp(), and stoch_comp_full().
| TimeAverageOut< T > line::lang::processes::time_average | ( | const MarkovChainModel< T > & | m, |
| const std::vector< T > & | pi0in, | ||
| const T & | t ) |
MarkovProcess.timeAverage: the law averaged over [0,t], and its endpoint.
Definition at line 471 of file markov_chain.h.
References line::mc::ctmc_timeaverage(), line::lang::processes::TimeAverageOut< T >::kmax, line::mc::TimeAverageResult< T >::kmax, line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::TimeAverageOut< T >::pi_exit, line::lang::processes::TimeAverageOut< T >::pi_time_avg, line::mc::TimeAverageResult< T >::piExit, line::mc::TimeAverageResult< T >::piTimeAvg, and time_average().
Referenced by time_average().
| MarkovChainModel< T > line::lang::processes::to_dtmc | ( | const MarkovChainModel< T > & | m | ) |
toDTMC, the backwards-compatible alias of toMarkovChain.
Definition at line 218 of file markov_chain.h.
References to_dtmc(), and to_markov_chain().
| MarkovChainModel< T > line::lang::processes::to_dtmc | ( | const MarkovChainModel< T > & | m, |
| const T & | q ) |
Definition at line 223 of file markov_chain.h.
References to_dtmc(), and to_markov_chain().
| MarkovChainModel< T > line::lang::processes::to_embedded | ( | const MarkovChainModel< T > & | m | ) |
MarkovProcess.toEmbedded: the JUMP CHAIN, the DTMC of the states visited at transition epochs.
IT DOES NOT PRESERVE THE STATIONARY LAW, and that is the point of having it separate from to_markov_chain. Dividing each off-diagonal row by the exit rate throws away how long the chain lingers, so a state with a fast exit rate is visited as often as a slow one and weighs the same here while weighing far less in the CTMC. An absorbing state (exit rate zero) has no next jump, and the reference makes it absorbing in the jump chain too rather than leaving an all-zero row that dtmc_makestochastic would have to invent a law for.
Definition at line 240 of file markov_chain.h.
References line::lang::processes::MarkovChainModel< T >::chain(), line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::MarkovChainModel< T >::state_space, and to_embedded().
Referenced by to_embedded().
| MarkovChainModel< T > line::lang::processes::to_markov_chain | ( | const MarkovChainModel< T > & | m | ) |
Definition at line 210 of file markov_chain.h.
References default_uniformization_rate(), line::lang::processes::MarkovChainModel< T >::mat, and to_markov_chain().
| MarkovChainModel< T > line::lang::processes::to_markov_chain | ( | const MarkovChainModel< T > & | m, |
| const T & | q ) |
MarkovProcess.toMarkovChain / toDTMC: the UNIFORMIZED chain, P = Q/q + I.
This is the conversion that PRESERVES the stationary distribution, and it is the one to reach for when the question is about long-run behaviour. Contrast to_embedded, which does not.
Definition at line 196 of file markov_chain.h.
References line::lang::processes::MarkovChainModel< T >::chain(), line::InputError::InputError(), line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::MarkovChainModel< T >::state_space, and to_markov_chain().
Referenced by to_dtmc(), to_dtmc(), to_markov_chain(), and to_markov_chain().
| MarkovChainModel< T > line::lang::processes::to_markov_process | ( | const MarkovChainModel< T > & | m | ) |
MarkovChain.toMarkovProcess / toCTMC: read the DTMC as a CTMC with unit exit rates, Q = P - I.
The stationary law is preserved, since P and P - I have the same left null structure up to the shift.
Definition at line 164 of file markov_chain.h.
References line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::MarkovChainModel< T >::process(), line::Matrix< T >::rows(), line::lang::processes::MarkovChainModel< T >::state_space, and to_markov_process().
Referenced by to_markov_process().
| MarkovChainModel< T > line::lang::processes::to_time_reversed | ( | const MarkovChainModel< T > & | m | ) |
toTimeReversed for either kind: the chain run backwards in time.
Definition at line 260 of file markov_chain.h.
References line::lang::processes::MarkovChainModel< T >::chain(), line::mc::ctmc_timereverse(), line::lang::processes::MarkovChainModel< T >::discrete, line::mc::dtmc_timereverse(), line::lang::processes::MarkovChainModel< T >::mat, line::lang::processes::MarkovChainModel< T >::process(), line::lang::processes::MarkovChainModel< T >::state_space, and to_time_reversed().
Referenced by to_time_reversed().