LINE Solver (C++)
Templated C++ port of the LINE queueing solver
Loading...
Searching...
No Matches
map_mmpp2.h File Reference

Fit an MMPP(2) to a mean, an SCV, a skewness and a lag-1 autocorrelation. More...

#include <cmath>
#include "line/api/mam/map_dist.h"
#include "line/api/mam/map_fit_detail.h"
#include "line/api/mam/map_moment.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for map_mmpp2.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
Map< T > line::mam::map_mmpp2 (const T &MEAN, const T &SCV_in, const T &SKEW, const T &ACF1)
 Fit an MMPP(2) to a mean, an SCV, a skewness and a lag-1 autocorrelation.

Detailed Description

Fit an MMPP(2) to a mean, an SCV, a skewness and a lag-1 autocorrelation.

Templated port of matlab/lib/kpctoolbox/map/map_mmpp2.m. An MMPP(2) is the two-state Markov-modulated Poisson process

D0 = [-mu00-q01, q01; q10, -mu11-q10], D1 = diag(mu00, mu11),

and the four rates are the closed-form inverse of its first three moments and its autocorrelation decay rate G2. That inverse is Maple output: two branches, the second some 18 KB of algebra in a single expression.

THE ALGEBRA IS MACHINE-TRANSCRIBED, NOT RETYPED. It was produced by cpp/tools/matlab_expr_to_cpp.py, which parses the MATLAB expression and re-emits it, then binds the repeated radicals and denominators to cseN temporaries (Maple repeats the same 2 KB radical dozens of times, so the literal form is both unreadable and O(repeats) to evaluate). The generated form was checked against the MATLAB source evaluated term by term on 40 random feasible inputs: the relative deviation is EXACTLY zero. Do not hand-edit the generated blocks; regenerate them.

THE FEASIBILITY GATES ARE THE REFERENCE'S, and each names what it refuses. An MMPP(2) is over-dispersed (SCV >= 1) and non-negatively autocorrelated, and at SCV = 1 exactly the fit is degenerate: G2 divides by (1 - 1/SCV) and every rate returns NaN, so that boundary is refused by name with a pointer to the Poisson process it is really asking for. ACF1 = -1 and SKEW = -1 are the reference's sentinels for "give me the extreme feasible value".

ARITHMETIC: transcendental, for the radicals.

Definition in file map_mmpp2.h.