LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
mmap_count_var.m
1function vk = mmap_count_var(mmap,t)
2% Computes the variance of the counting process, at resolution t, for the
3% given Marked MAP.
4% Input:
5% - mmap: the Marked MAP
6% - t: the period considered for each sample of the counting process
7% Output:
8% - vk: the vector with the variance for each job class
9
10n = size(mmap{1},1);
11K = size(mmap,2)-2;
12
13if map_issym(mmap)
14 I = sym(eye(n));
15 e = sym(ones(n,1));
16 lk = sym(zeros(K,1));
17 ck = sym(zeros(K,n));
18 dk = sym(zeros(n,K));
19 llk = sym(zeros(K,1));
20 vk = sym(zeros(K,1));
21else
22 I = eye(n);
23 e = ones(n,1);
24 lk = zeros(K,1);
25 ck = zeros(K,n);
26 dk = zeros(n,K);
27 llk = zeros(K,1);
28 vk = zeros(K,1);
29end
30
31D = mmap{1} + mmap{2};
32theta = map_prob(mmap);
33tmp = (e * theta - D)^(-1);
34
35for k=1:K
36 % arrival rate
37 lk(k) = theta * mmap{2+k} * e;
38 ck(k,:) = theta * mmap{2+k} * tmp;
39 dk(:,k) = tmp * mmap{2+k} * e;
40 llk(k) = theta * mmap{2+k} * e;
41end
42
43for k=1:K
44 vk(k) = (llk(k)-2*lk(k)^2 + 2*ck(k,:)*mmap{2+k}*e)*t - 2*ck(k,:)*(I-expm(D*t))*dk(:,k);
45end
46
47end