LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
dmap_moment.m
1function MOMENTS=dmap_moment(DMAP,ORDERS)
2% MOMENTS=dmap_moment(DMAP,ORDERS) - Compute factorial moments of
3% inter-arrival times for a discrete-time MAP
4%
5% Input:
6% DMAP: a D-MAP in the form of {D0,D1}
7% ORDERS: set of moment orders (1=>E[X], 2=>E[X^2], ...)
8%
9% Output:
10% MOMENTS: moments returned in the same order of ORDERS
11
12D0=DMAP{1};
13D1=DMAP{2};
14N=size(D0,1);
15e=ones(N,1);
16P=inv(eye(N)-D0)*D1;
17al=dtmc_solve(P);
18for t=1:length(ORDERS)
19 i=ORDERS(t);
20 if isnan(D0)
21 MOMENTS(t)=NaN;
22 else
23 A=(inv(eye(N)-D0)^i);
24 MOMENTS(t)=factorial(i)*al*A*e;
25 end
26end
27end