![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Fit a MAMAP(2,m): a second-order acyclic MAP marked with m classes, matching the forward and backward per-class moments. More...
#include <cmath>#include <cstddef>#include <vector>#include "line/api/mam/amap2_fit_gamma.h"#include "line/api/mam/mamap22_fit_fs.h"#include "line/api/mam/mamap_marked_poisson.h"#include "line/api/mam/map_moment.h"#include "line/api/mam/map_transform.h"#include "line/api/mam/maph2m_fit.h"#include "line/api/mam/mmap_compress.h"#include "line/api/mam/mmap_lambda.h"#include "line/api/mam/mmap_stats.h"#include "line/api/trace/mtrace_backward_moment.h"#include "line/api/trace/mtrace_forward_moment.h"#include "line/api/trace/mtrace_sigma.h"#include "line/api/trace/trace_gamma.h"#include "line/api/trace/mtrace_pc.h"#include "line/num/number.h"#include "line/util/auglag.h"#include "line/util/error.h"#include "line/util/matrix.h"Go to the source code of this file.
Classes | |
| struct | line::mam::Mamap2mFitResult< T > |
| The fitted MAMAP and the moments it achieved. More... | |
Namespaces | |
| namespace | line |
| namespace | line::mam |
Functions | |
| template<class T> | |
| Mamap2mFitResult< T > | line::mam::mamap2m_fit_fb_multiclass (const Map< T > &map, const std::vector< T > &p, const std::vector< T > &F, const std::vector< T > &B, const std::vector< T > &classWeights=std::vector< T >(), const std::vector< T > &fbWeights=std::vector< T >()) |
| Mark a canonical acyclic AMAP(2) with m classes, matching the forward and backward moments. | |
| template<class T> | |
| Mmap< T > | line::mam::mamap2m_fit_gamma_fb (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &F, const std::vector< T > &B) |
| Fit a MAMAP(2,m) to three moments, the decay rate, the class probabilities and the forward and backward moments, over every AMAP(2) form. | |
| template<class T> | |
| Mmap< T > | line::mam::mamap2m_fit (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &F, const std::vector< T > &B, const Matrix< T > &S, const std::vector< T > &fbsWeights=std::vector< T >()) |
| The full mamap2m_fit dispatcher. | |
| template<class T> | |
| Mmap< T > | line::mam::mamap2m_fit_gamma_fb_trace (const std::vector< T > &Tv, const std::vector< int > &A) |
| Fit a MAMAP(2,m) from a marked trace through the (F, B) pair alone. | |
| template<class T> | |
| Mmap< T > | line::mam::mamap2m_fit_trace (const std::vector< T > &Tv, const std::vector< int > &A, const std::vector< T > &fbsWeights=std::vector< T >()) |
| Fit a MAPH(2,m) or MAMAP(2,m) matching the characteristics of a marked trace. | |
Fit a MAMAP(2,m): a second-order acyclic MAP marked with m classes, matching the forward and backward per-class moments.
Templated port of matlab/lib/m3a/m3a/mamap2m/mamap2m_fit_fb_multiclass.m, mamap2m_fit_gamma_fb.m and mamap2m_fit_trace.m.
As in maph2m_fit.h, the TIMING and the MARKING separate: an AMAP(2) fixed by (M1, M2, M3, gamma) carries the inter-arrival law and its autocorrelation decay, and the class marking splits the THREE arrival flows of the canonical acyclic form among the m classes. The per-class forward and backward moments are affine in that split,
q(j,c) = fF(c) q_f(j,c) + fB(c) q_b(j,c) + q_0(j,c),
so the fit is again a convex quadratic program, here in 2k variables (a forward and a backward moment per class) under three equality constraints, one per flow, and 6k inequalities keeping every q in [0,1].
SIX BRANCHES, and which one fires is decided by the AMAP's own degeneracies, not by the data. With h1, h2 the phase means, r1 the branch probability out of phase one and r2 the restart probability into phase two:
WHICH CANONICAL FORM. form 1 (D1(1,2) = 0) carries a positive autocorrelation decay and form 2 (D1(1,1) = 0) a negative one; the coefficient sets differ and are not interchangeable. Anything else is refused, because the coefficients were derived for these two forms only.
THE SOLVER IS NOT quadprog; see the same note in maph2m_fit.h. The acceptance is the specification: the class probabilities are reproduced, the inter-arrival law is the AMAP's, and the forward and backward moments approach their targets as far as the feasibility of the split allows.
ARITHMETIC: transcendental, through the fitters and the solver.
Definition in file mamap2m_fit.h.