61 const T& m3t2,
const T& t1,
const T& t2,
const std::vector<T>& ai,
62 const std::vector<T>& dvt3,
const T& t3) {
64 "m3pp2m_fitc requires transcendental arithmetic");
65 using fitdetail::num_exp;
72 const std::size_t m = ai.size();
73 if (m == 0)
throw InputError(
"m3pp2m_fitc: no classes");
74 if (dvt3.size() + 1 < m)
throw InputError(
"m3pp2m_fitc: dvt3 shorter than the class count");
76 for (std::size_t i = 0; i < m; ++i) asum += ai[i];
78 throw InputError(
"m3pp2m_fitc: inconsistent per-class arrival rates");
89 for (std::size_t i = 0; i < m; ++i) {
91 res.
mmap.Dc.push_back(Dc);
96 const T l1 = base.
map.D1(0, 0);
97 const T l2 = base.
map.D1(1, 1);
98 const T r1 = base.
map.D0(0, 1);
99 const T r2 = base.
map.D0(1, 0);
102 const T SH = (one - num_exp(T(-(r1 + r2) * t))) / two;
104 std::vector<T> q1(m, zero), q2(m, zero);
105 for (std::size_t i = 0; i + 1 < m; ++i) {
107 const T dv_1 = dvt3[i];
108 q1[i] = -(dv_1*pw(r1,4) + dv_1*pw(r2,4) - 2*a_1*pw(r1,4)*t - 2*a_1*pw(r2,4)*t + 4*dv_1*r1*pw(r2,3) +
109 4*dv_1*pw(r1,3)*r2 + l1*pw(r2,4)*t + l2*pw(r1,4)*t + 6*dv_1*pw(r1,2)*pw(r2,2) + 4*a_1*l1*pw(r2,3)*
110 t - 4*a_1*l2*pw(r2,3)*t - 8*a_1*r1*pw(r2,3)*t - 8*a_1*pw(r1,3)*r2*t + 3*l1*r1*pw(r2,3)*t + l1*
111 pw(r1,3)*r2*t + l2*r1*pw(r2,3)*t + 3*l2*pw(r1,3)*r2*t - 12*a_1*pw(r1,2)*pw(r2,2)*t + 3*l1*pw(r1,2)*
112 pw(r2,2)*t + 2*pw(l1,2)*r1*pw(r2,2)*t + 2*pw(l1,2)*pw(r1,2)*r2*t + 3*l2*pw(r1,2)*pw(r2,2)*t +
113 2*pw(l2,2)*r1*pw(r2,2)*t + 2*pw(l2,2)*pw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(r1,2)*
125 r2*t + 4*a_1*l2*r1*pw(r2,2)*t + 8*a_1*l2*pw(r1,2)*r2*t - 4*l1*l2*r1*pw(r2,2)*t - 4*l1*l2*pw(r1,2)*
126 r2*t + 8*a_1*l1*r1*r2*SH - 8*a_1*l2*r1*r2*SH + 8*l1*l2*r1*r2*SH)/(4*(r1 + r2)*(pw(l2,2)*pw(r1,2)*
127 t - 2*pw(l2,2)*r1*SH - l1*l2*pw(r1,2)*t + pw(l2,2)*r1*r2*t + 2*l1*l2*r1*SH - l1*l2*r1*r2*t));
129 T s1 = zero, s2 = zero;
130 for (std::size_t i = 0; i + 1 < m; ++i) {
134 q1[m - 1] = one - s1;
135 q2[m - 1] = one - s2;
137 for (std::size_t i = 0; i < m; ++i) {
139 Dc(0, 0) = q1[i] * base.
map.D1(0, 0);
140 Dc(1, 1) = q2[i] * base.
map.D1(1, 1);
141 res.
mmap.Dc.push_back(Dc);
Mmpp2FitcResult< T > mmpp2_fitc(const T &mu, const T &bt1, const T &bt2, const T &binf, const T &m3t2, const T &t1, const T &t2)
MMPP(2) from the arrival rate, the IDC at t1, t2 and infinity, and the third central moment of the co...