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

Cumulative distribution of the inter-arrival time of a MAP. More...

#include <cstddef>
#include <vector>
#include "line/api/mam/map_moment.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/expm.h"
#include "line/util/linalg.h"
#include "line/util/matrix.h"
Include dependency graph for map_cdf.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::mam

Functions

template<class T>
std::vector< T > line::mam::map_cdf (const Map< T > &m, const std::vector< T > &points)
 Cumulative distribution of the inter-arrival time at the given points.

Detailed Description

Cumulative distribution of the inter-arrival time of a MAP.

Templated port of matlab/lib/kpctoolbox/map/map_cdf.m, cross-checked against jar/src/main/java/jline/api/mam/Map_cdf.java.

Conditional on the phase pie seen by an arrival, the next inter-arrival time is phase-type with representation (pie, D0), so

F(t) = 1 - pie exp(D0 t) e, f(t) = pie exp(D0 t) (-D0) e.

ARITHMETIC: exp(D0 t) is a tolerance-controlled approximation, so both functions require transcendental arithmetic; pie itself is exact (a linear solve, see map_moment.h).

DIVERGENCE, MATLAB vs JAR: MATLAB evaluates exp(D0 t) directly for every process. The JAR switches to Foxglynn uniformization when D0 has no negative off-diagonal entry and to a direct exponential otherwise, because uniformization is invalid for an ME/RAP representation whose D0 is not a sub-generator. This port follows MATLAB and always uses the exponential, which is correct for both cases. NOTE, MEASURED: the uniformization path is not merely faster, it is also the ACCURATE one at small t. F(t) = 1 - s here loses every significant digit once s is within a few ulp of one, so for a value far below the rounding of s this function returns round-off of either sign; uniformization with an explicit absorbing state sums only nonnegative terms and stays exact. pfqn_stdf therefore evaluates its level CDFs by that construction (detail::stdf_hypoexp_cdf) rather than through this function. Any caller of map_cdf that needs a small CDF accurately has the same problem and no fix. The JAR additionally clamps a NaN CDF value to the previous finite one, which is a workaround, not a definition, and is not reproduced.

Definition in file map_cdf.h.