LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
dtmc_timereverse.m
1%{ @file dtmc_timereverse.m
2 % @brief Computes the time-reversed transition matrix of a DTMC
3 %
4 % @author LINE Development Team
5%}
6
7%{
8 % @brief Computes the time-reversed transition matrix of a DTMC
9 %
10 % @details
11 % Computes the transition matrix of the time-reversed process.
12 %
13 % @par Syntax:
14 % @code
15 % Prev = dtmc_timereverse(P)
16 % @endcode
17 %
18 % @par Parameters:
19 % <table>
20 % <tr><th>Name<th>Description
21 % <tr><td>P<td>Stochastic transition matrix of the original process
22 % </table>
23 %
24 % @par Returns:
25 % <table>
26 % <tr><th>Name<th>Description
27 % <tr><td>Prev<td>Stochastic transition matrix of the time-reversed process
28 % </table>
29%}
30function Prev=dtmc_timereverse(P)
31K=length(P);
32Prev=P;
33pie=dtmc_solve(P);
34for i=1:K
35 for j=1:K
36 Prev(i,j)=P(i,j)*pie(i)/pie(j);
37 end
38end
39Prev=Prev';
40end