LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
m3pp_superpos_fitc.m
1function [fit,m3pps] = m3pp_superpos_fitc(av, btv, binfv, ...
2 m3tv, t, tinf)
3% Fits k second-order M3PP[m_j] and superposes them into a
4% M3PP[m] of order k+1, with m = \sum_j=1^k m_j.
5%
6% INPUT
7% av: vector of length m with the per-process rates
8% btv: vector of length k with the per-process IDC(t)
9% binfv: vector of length k with the per-process IDC(inf)
10% m3tv: third moment of counts
11% t: finite time scale
12% tinf: near-infinite time scale
13%
14% OUTPUT
15% fit: result of the superposition, M3PP[m] of order k+1
16% m3pps: cell-array with the fitted and superposed second-order
17% M3PP[m_j]
18
19% number of classes
20m = length(av);
21
22% total rate
23a = sum(av);
24
25% fit m3pp[2] processes
26m3pps = cell(m,1);
27for i = 1:m
28 mmpp = mmpp2_fitc(av(i), ...
29 btv(i), btv(i), binfv(i), ...
30 m3tv(i), t, tinf);
31 m3pps{i} = {mmpp{1},mmpp{2},mmpp{2}};
32end
33
34% perform superposition
35fit = mmap_superpos(m3pps);
36% compare
37fa = map_count_mean(fit,1);
38fprintf('Rate: input = %f, %f\n', a, fa);
39fav = mmap_count_mean(fit,1);
40for i = 1:m
41 fprintf('Class %d, rate: input = %f, output = %f\n', i, av(i), fav(i));
42end
43fbtv = mmap_count_var(fit,t) ./ (av * t);
44for i = 1:m
45 fprintf('Class %d, IDC(%.2f): input = %f, output = %f\n', i, t, btv(i), fbtv(i));
46end
47fbinfv = mmap_count_var(fit,tinf) ./ (av * tinf);
48fbinfv_limit = mmap_count_var(fit, 1e6) ./ (av * 1e6);
49for i = 1:m
50 fprintf('Class %d, IDC(inf = %.2f): input = %f, output = %f, output_limit = %f\n', i, tinf, binfv(i), fbinfv(i), fbinfv_limit(i));
51end
52
53end