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

Fit a MAMAP(2,2) matching the FORWARD moment and the class TRANSITION probability sigma. More...

Include dependency graph for mamap22_fit_fs.h:

Go to the source code of this file.

Classes

struct  line::mam::Mamap22FsFitResult< T >
 The forward-plus-sigma result; warning carries the reference's diagnostic. More...

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
Mamap22FsFitResult< T > line::mam::mamap22_fit_fs_multiclass (const Map< T > &map, const std::vector< T > &p, const std::vector< T > &F, const Matrix< T > &S, const std::vector< T > &classWeights=std::vector< T >(), const std::vector< T > &fsWeights=std::vector< T >(), bool adjust=true)
template<class T>
Mmap< T > line::mam::mamap22_fit_gamma_fs (const T &M1, const T &M2, const T &M3, const T &GAMMA, const std::vector< T > &p, const std::vector< T > &F, const Matrix< T > &S)
 mamap22_fit_gamma_fs: fit over every AMAP(2) form and keep the closest.
template<class T>
Mmap< T > line::mam::mamap22_fit_gamma_fs_trace (const std::vector< T > &Tv, const std::vector< int > &A)
 mamap22_fit_gamma_fs driven from a marked trace.

Detailed Description

Fit a MAMAP(2,2) matching the FORWARD moment and the class TRANSITION probability sigma.

Templated port of matlab/lib/m3a/m3a/mamap22/mamap22_fit_fs_multiclass.m, the twin of mamap22_fit_bs.h. The structure is the same – a closed-form inverse over the coefficient tables of mamap2m_coefficients.h, with five degenerate branches ahead of it – and only the inverse itself differs, reading the FORWARD block of the tables (U(1..6), G(13..15), Y(2)) where the backward fitter reads U(7..12), G(10..12) and Y(3).

TWO CLASSES ONLY, as in the backward twin, and for the same reason.

ONE BRANCH DIFFERS SUBSTANTIVELY from the backward fitter and is worth naming: the CANONICAL PHASE-TYPE case (form 1, r2 = 0). The reference falls back to maph2m_fit_multiclass, which fits BACKWARD moments, and it has no forward targets to give it – so it sets both backward targets to the ordinary mean and WARNS that the caller should have used B+S instead. That warning is reproduced as a named diagnostic on the result rather than dropped, because a caller who asked for a forward fit and silently got a mean-matched backward one has no other way to find out. It also re-fits the timing as an APH(2) when the SCV has fallen to one, which is the hypoexponential boundary where the canonical form stops being informative.

WHAT IS NOT PORTED, refused by name: the same nonconvex repair as the backward twin – YALMIP bmibnb, a spatial branch-and-bound returning a GLOBAL optimum of a bilinear program. line/util/auglag.h finds a local KKT point, which on a nonconvex set is a different answer; substituting it would report a fit the reference would not have chosen. The gamma < 0 degeneracy's sigma arm IS ported: the reference states it as a YALMIP program, but its feasible set is an interval and its objective is (x - S11)^2, so the projection is its exact global optimum.

ARITHMETIC: transcendental.

Definition in file mamap22_fit_fs.h.