3% Computes the stationary solution of a continuous time
4% rational process (CRP).
8% Q : matrix, shape (M,M)
9% The generator matrix of the rational process
13% pi : row vector, shape (1,M)
14% The vector that satisfies
15% `\pi\, Q = 0, \sum_i \pi_i=1`
19% Continuous time rational processes are like continuous
20% time Markov chains, but the generator does not have to
21% pass the :func:`CheckGenerator` test (but the rowsums
22% still have to be zeros).
24function pi = CRPSolve (Q)
26 global BuToolsCheckInput;
27 if isempty(BuToolsCheckInput)
28 BuToolsCheckInput =
true;
30 global BuToolsCheckPrecision;
31 if isempty(BuToolsCheckPrecision)
32 BuToolsCheckPrecision = 1e-14;
35 if BuToolsCheckInput && any(abs(sum(Q,2))>BuToolsCheckPrecision)
36 error(
'CRPSolve: The matrix has a rowsum which isn''t zero!');
41 m = zeros(1,size(M,1));