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

Marked MAP statistics: embedded chains, class-transition probabilities, forward and cross moments, counting means and covariances. More...

#include <cstddef>
#include <vector>
#include "line/api/mam/map_moment.h"
#include "line/api/mam/map_transform.h"
#include "line/api/mam/mmap_count_var.h"
#include "line/api/mam/mmap_lambda.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/linalg.h"
#include "line/util/lu.h"
#include "line/util/matrix.h"
Include dependency graph for mmap_stats.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
std::vector< Matrix< T > > line::mam::mmap_embedded (const Mmap< T > &mm)
 Embedded per-class kernels E_c = (-D0)^-1 D1^(c).
template<class T>
std::vector< Map< T > > line::mam::mmap_maps (const Mmap< T > &mm)
 The C MAPs seen by each class, MAP_c = (D0 + D1 - D1^(c), D1^(c)).
template<class T>
Matrix< T > line::mam::mmap_pie (const Mmap< T > &mm)
 Stationary phase distribution seen just after a class-c arrival, one row per class.
template<class T>
Mmap< T > line::mam::mmap_timereverse (const Mmap< T > &mm)
 Time-reversed MMAP, D^-1 M' D with D = diag(map_prob) applied to every matrix.
template<class T>
Matrix< T > line::mam::mmap_sigma (const Mmap< T > &mm)
 sigma(i,j) = pie E_i E_j 1, the probability that two consecutive marks are (i,j).
template<class T>
std::vector< std::vector< std::vector< T > > > line::mam::mmap_sigma2 (const Mmap< T > &mm)
 sigma2(i,j,h) = pie E_i E_j E_h 1, indexed as sigma2[i][j][h].
template<class T>
std::vector< T > line::mam::mmap_count_mean (const Mmap< T > &mm, const T &t)
 Per-class mean of the counting process over a window of length t.
template<class T>
std::vector< T > line::mam::mmap_count_idc (const Mmap< T > &mm, const T &t)
 Per-class index of dispersion of counts over a window of length t.
template<class T>
std::vector< T > line::mam::mmap_idc (const Mmap< T > &mm)
 Asymptotic per-class index of dispersion, evaluated at t = 1e6 / sum_c lambda_c.
template<class T>
Matrix< T > line::mam::mmap_count_mcov (const Mmap< T > &mm, const T &t)
 Covariance matrix of the per-class counts over a window of length t.
template<class T>
Matrix< T > line::mam::mmap_cross_moment (const Mmap< T > &mm, unsigned k)
 Cross moments of order k: MC(i,j) is E[T^k] of the interval that FOLLOWS a class-i arrival, conditioned on that next arrival being of class j.
template<class T>
Matrix< T > line::mam::mmap_forward_moment (const Mmap< T > &mm, const std::vector< unsigned > &orders, bool normalize)
 Forward moments: MOMENTS(a,h) is the order-orders[h] moment of the interval ENDING with a class-a arrival.
template<class T>
Matrix< T > line::mam::mmap_forward_moment (const Mmap< T > &mm, const std::vector< unsigned > &orders)
 Default normalization, matching the two-argument MATLAB call.
template<class T>
Mmap< T > line::mam::mmap_sum (const Mmap< T > &mm, unsigned n)
 MMAP of the sum of n independent copies, a block bidiagonal concatenation.

Detailed Description

Marked MAP statistics: embedded chains, class-transition probabilities, forward and cross moments, counting means and covariances.

Templated port of the M3A MMAP statistics in matlab/lib/m3a/m3a/mmap: mmap_pie.m, mmap_embedded.m, mmap_maps.m, mmap_timereverse.m, mmap_sigma.m, mmap_sigma2.m, mmap_count_mean.m, mmap_count_idc.m, mmap_count_mcov.m, mmap_idc.m, mmap_cross_moment.m, mmap_forward_moment.m and mmap_sum.m.

The embedded per-class matrix is E_c = (-D0)^-1 D1^(c). It is SUBstochastic, not stochastic: its row sums give the probability that the next arrival is of class c, which is what makes sum_c E_c the embedded chain of the aggregate MAP and E_c on its own the class-c defective kernel. Reading E_c as a transition matrix and renormalizing it is the classic way to get the per-class moments wrong.

mmap_issym and mmap_shorten have no C++ counterpart: the first asks whether the MATLAB cell holds symbolic entries, which here is the template parameter, and the second reorders a MATLAB cell into BUTools order, which the Mmap struct already encodes by construction.

Definition in file mmap_stats.h.