MarkovProcessProperties[mproc]
gives a summary of properties for the finite state Markov process mproc.
MarkovProcessProperties[mproc,"property"]
gives the specified "property" for the process mproc.
MarkovProcessProperties
MarkovProcessProperties[mproc]
gives a summary of properties for the finite state Markov process mproc.
MarkovProcessProperties[mproc,"property"]
gives the specified "property" for the process mproc.
Details
- MarkovProcessProperties can be used for finite state Markov processes such as DiscreteMarkovProcess and ContinuousMarkovProcess.
- MarkovProcessProperties[mproc,"Properties"] gives a list of available properties.
- MarkovProcessProperties[mproc,"property","Description"] gives a description of the property as a string.
- Basic properties include:
-
"InitialProbabilities" initial state probability vector "TransitionMatrix" conditional transition probabilities m "TransitionRateMatrix" conditional transition rates q "TransitionRateVector" state transition rates μ "HoldingTimeMean" mean holding time for a state "HoldingTimeVariance" variance of holding time for a state "SummaryTable" summary of properties - For a continuous-time Markov process "TransitionMatrix" gives the transition matrix of the embedded discrete-time Markov process.
- The holding time is the time spent in each state before transitioning to a different state. This takes into account self-loops which may cause the process to transition to the same state several times.
- Structural properties include:
-
"CommunicatingClasses" sets of states accessible from each other "RecurrentClasses" communicating classes that cannot be left "TransientClasses" communicating classes that can be left "AbsorbingClasses" recurrent classes with a single element "PeriodicClasses" communicating classes with finite period greater than 1 "Periods" period for each of the periodic classes "Irreducible" whether the process has a single recurrent class "Aperiodic" whether all classes are aperiodic "Primitive" whether the process is irreducible and aperiodic - The states of a finite Markov process can be grouped into communicating classes where from each state in a class there is a path to every other state in the class.
- A communicating class can be transient when there is a path from the class to another class or recurrent when there is not. A special type of recurrent class, called absorbing, consist of a single element.
- A state is periodic is if there is a non-zero probability that you return to the state after two or more steps. All the states in a class have the same period.
- Transient properties before the process enters a recurrent class:
-
"TransientVisitMean" mean number of visits to each transient state "TransientVisitVariance" variance of number of visits to each transient state "TransientTotalVisitMean" mean total number of transient states visited - A Markov process will eventually enter a recurrent class. The transient properties characterize how many times each transient state is visited or how many different transient states are visited.
- Limiting properties include:
-
"ReachabilityProbability" probability of ever reaching a state "LimitTransitionMatrix" Cesaro limit of the transition matrix "Reversible" whether the process is reversible - If a property is not available, this is indicated by Missing["reason"].
Examples
open all close allBasic Examples (2)
proc = DiscreteMarkovProcess[3, {{1 / 2, 1 / 2, 0, 0}, {1 / 2, 1 / 2, 0, 0}, {1 / 4, 1 / 4, 1 / 4, 1 / 4}, {0, 0, 0, 1}}];Graph[proc]MarkovProcessProperties[proc]Find the values of a specific property:
proc = ContinuousMarkovProcess[1, {{-a, a}, {0, 0}}];MarkovProcessProperties[proc, "RecurrentClasses"]MarkovProcessProperties[proc, "RecurrentClasses", "Description"]Scope (5)
Find the communicating classes, highlighted in the graph through different colors:
proc = DiscreteMarkovProcess[1, {{0, 1 / 3, 0, 2 / 3, 0}, {1 / 2, 0, 0, 0, 1 / 2}, {0, 0, 1 / 2, 1 / 2, 0}, {0, 0, 1 / 2, 1 / 2, 0}, {0, 0, 0, 0, 1}}];gr = Graph[proc, GraphLayout -> "LayeredDrawing"]MarkovProcessProperties[proc, "CommunicatingClasses"]ConnectedComponents[gr]The process is not irreducible:
MarkovProcessProperties[proc, "Irreducible"]ConnectedGraphQ[gr]Find the recurrent classes, represented by square and circular vertices in the graph:
MarkovProcessProperties[proc, "RecurrentClasses"]Select[ConnectedComponents[gr], Complement[VertexOutComponent[gr, #], #] === {}&]Find the transient classes, represented by diamond vertices in the graph:
MarkovProcessProperties[proc, "TransientClasses"]Select[ConnectedComponents[gr], Complement[VertexOutComponent[gr, #], #] =!= {}&]Find the absorbing classes, represented by square vertices in the graph:
MarkovProcessProperties[proc, "AbsorbingClasses"]Position[VertexOutDegree[SimpleGraph[gr]], 0]Define a Markov process with self-loops:
proc1 = DiscreteMarkovProcess[1, {{0, 1 / 3, 0, 2 / 3}, {1, 0, 0, 0}, {0, 0, 1 / 2, 1 / 2}, {0, 0, 1 / 2, 1 / 2}}];Graph[proc1]The self-loops make the class
aperiodic:
MarkovProcessProperties[proc1, "PeriodicClasses"]Markov process with no self-loops:
proc2 = DiscreteMarkovProcess[1, {{0, 1 / 3, 0, 2 / 3}, {1, 0, 0, 0}, {0, 0, 0, 1}, {0, 0, 1, 0}}];Graph[proc2]Here both classes are periodic:
MarkovProcessProperties[proc2, "PeriodicClasses"]Summary table of properties for a continuous-time Markov process:
proc = ContinuousMarkovProcess[1, With[{λ = 3, μ = 2}, {{-λ, λ, 0}, {μ, -λ - μ, λ}, {0, μ, -μ}}]];Graph[proc]MarkovProcessProperties[proc]Obtain the value for a specific property for a continuous Markov chain:
proc = ContinuousMarkovProcess[1, With[{λ = 3, μ = 2}, {{-λ, λ, 0}, {μ, -λ - μ, λ}, {0, μ, -μ}}]];MarkovProcessProperties[proc, "TransitionMatrix"]//MatrixFormListLinePlot[RandomFunction[proc, {0, 5}]["Paths"], Ticks -> {Automatic, Range[3]}]ListLinePlot[RandomFunction[DiscreteMarkovProcess[1, MarkovProcessProperties[proc, "TransitionMatrix"]], {0, 10}]["Paths"], Ticks -> {Automatic, Range[3]}]Find the conditional mean number of total transitions starting in state 1 and ending in state 4:
𝒫 = ContinuousMarkovProcess[{1, 0, 0, 0}, {{-3, 1, 2, 0}, {3, -6, 2, 1}, {4, 2, -9, 3}, {0, 0, 0, 0}}];MarkovProcessProperties[𝒫, "TransitionCount"][[4]][100] / Probability[x[100] == 4, x𝒫]N[%]//QuietCompare with the results from simulation:
data = RandomFunction[𝒫, {0, 100}, 4 * 10 ^ 4, Method -> {Automatic, "StoppingFunction" -> (#3 =!= 4&)}]["ValueList"];N[Mean[Length[#] - 1& /@ data]]Find the conditional mean number of transitions from state 2 to state 3:
𝒫 = ContinuousMarkovProcess[{1, 0, 0, 0}, {{-3, 1, 2, 0}, {3, -6, 2, 1}, {4, 2, -9, 3}, {0, 0, 0, 0}}];MarkovProcessProperties[𝒫, {"TransitionCount", {{2, 3}}}][[4]][100] / Probability[x[100] == 4, x𝒫]N[%]//QuietCompare with the results from simulation:
data = RandomFunction[𝒫, {0, 10 ^ 3}, 10 ^ 4, Method -> {Automatic, "StoppingFunction" -> (#3 =!= 4&)}]["ValueList"];N[Mean[Count[Partition[data[[#]], 2, 1], {2, 3}]& /@ Range[Length[data]]]]Applications (2)
A gambler starts with $3 and bets $1 at each step. He wins $1 with a probability of 0.4:
GamblersRuin[p_, n_] := SparseArray[{{1, 1} -> 1, {n + 1, n + 1} -> 1, {i_, j_} /; 1 < i < n + 1 && j == i + 1 -> p, {i_, j_} /; 1 < i < n + 1 && j == i - 1 -> 1 - p}, {n + 1, n + 1}]gamblerwealth = DiscreteMarkovProcess[4, GamblersRuin[0.4, 7]];Find the expected number of times the gambler has
units:
Transpose[{MarkovProcessProperties[gamblerwealth, "TransientClasses"][[1]] - 1, MarkovProcessProperties[gamblerwealth, "TransientVisitMean"]}]//GridVerify the answer using simulation:
data = RandomFunction[gamblerwealth, {0, 10 ^ 3}, 10 ^ 4, Method -> {Automatic, "StoppingFunction" -> Function[{len, pos}, len < 1001 && pos ≠ 1 && pos ≠ 8]}]["ValueList"];Table[Mean[Count[#, i]& /@ data], {i, 2, 7}]//NFind the expected time until the gambler wins $7 or goes broke:
Mean[FirstPassageTimeDistribution[gamblerwealth, {1, 8}]]Total states visited before the gambler wins $7 or goes broke:
MarkovProcessProperties[gamblerwealth, "TransientTotalVisitMean"]Verify the answer using simulation:
data = DeleteDuplicates /@ RandomFunction[gamblerwealth, {0, 10 ^ 2}, 4 * 10 ^ 3]["ValueList"];Mean[Length[#] - 1& /@ data]//NIn a game of tennis between two players, suppose the probability of the server winning a point is
. There are 17 possible states:
states = {"GameA", "GameB", "Deux", "AdvA", "AdvB", "40-15", "15-40", "40-0", "30-15", "15-30", "0-40", "30-0", "15-15", "0-30", "15-0", "0-15", "0-0"};Visualize the random walk graph for
:
proc = With[{p = 3 / 5, q = 2 / 5}, DiscreteMarkovProcess[17, (| | | | | | | | | | | | | | | | | |
| - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - |
| 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0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 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | p | q | 0 |)]];Graph[proc, VertexSize -> Large, VertexLabels -> Thread[Range[17] -> Map[Placed[Style[#, {Bold}], Center]&, states]], ImageSize -> Large, ImagePadding -> 25]Find the probability of the server winning the game if
:
MarkovProcessProperties[proc, "ReachabilityProbability"][[1]]//NPDF[proc[Infinity], 1]//NFind the mean time to absorption, that is, the number of points played:
Total[MarkovProcessProperties[proc, "TransientVisitMean"]]//NN[Mean[FirstPassageTimeDistribution[proc, {1, 2}]]]Find the mean number of states visited:
MarkovProcessProperties[proc, "TransientTotalVisitMean"]//NFind the average number of times the score will be tied at deuce:
MarkovProcessProperties[proc, "TransientVisitMean"][[1]]//NVerify the answer using simulation:
Mean[Count[#, 3]& /@ RandomFunction[proc, {0, 10 ^ 3}, 10 ^ 4, Method -> {Automatic, "StoppingFunction" -> Function[{len, pos}, len < 1001 && pos ≠ 1 && pos ≠ 2]}]["ValueList"]]//NProperties & Relations (1)
The transition matrix of this Markov process is not irreducible:
proc = DiscreteMarkovProcess[i, {{(1/2), (1/2), 0, 0, 0}, {(1/3), (2/3), 0, 0, 0}, {0, (1/3), (2/3), 0, 0}, {0, 0, 0, 0, 1}, {0, 0, 0, 1, 0}}];MarkovProcessProperties[proc, "Irreducible"]Hence the stationary distribution depends on the initial state probabilities:
StationaryDistribution[DiscreteMarkovProcess[1, {{(1/2), (1/2), 0, 0, 0}, {(1/3), (2/3), 0, 0, 0}, {0, (1/3), (2/3), 0, 0}, {0, 0, 0, 0, 1}, {0, 0, 0, 1, 0}}]]StationaryDistribution[DiscreteMarkovProcess[4, {{(1/2), (1/2), 0, 0, 0}, {(1/3), (2/3), 0, 0, 0}, {0, (1/3), (2/3), 0, 0}, {0, 0, 0, 0, 1}, {0, 0, 0, 1, 0}}]]Possible Issues (1)
Some property values may not be available:
MarkovProcessProperties[DiscreteMarkovProcess[1, {{1 / 3, 2 / 3}, {1 / 2, 1 / 2}}], "TransitionRateVector"]This property is available only for continuous Markov processes:
MarkovProcessProperties[ContinuousMarkovProcess[1, {{-2 / 3, 2 / 3}, {1 / 2, -1 / 2}}], "TransitionRateVector"]Related Guides
History
Text
Wolfram Research (2012), MarkovProcessProperties, Wolfram Language function, https://reference.wolfram.com/language/ref/MarkovProcessProperties.html.
CMS
Wolfram Language. 2012. "MarkovProcessProperties." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MarkovProcessProperties.html.
APA
Wolfram Language. (2012). MarkovProcessProperties. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MarkovProcessProperties.html
BibTeX
@misc{reference.wolfram_2026_markovprocessproperties, author="Wolfram Research", title="{MarkovProcessProperties}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/MarkovProcessProperties.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_markovprocessproperties, organization={Wolfram Research}, title={MarkovProcessProperties}, year={2012}, url={https://reference.wolfram.com/language/ref/MarkovProcessProperties.html}, note=[Accessed: 12-June-2026]}