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

Variance of the counting process of a MAP at resolution t. 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_count_var.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_count_var (const Map< T > &m, const std::vector< T > &t)
 Variance of the counting process of a MAP at resolution t.

Detailed Description

Variance of the counting process of a MAP at resolution t.

Templated port of matlab/lib/kpctoolbox/map/map_count_var.m, cross-checked against jar/src/main/java/jline/api/mam/Map_count_var.java. With D = D0 + D1, theta the stationary phase vector, e the vector of ones and the deviation matrix tmp = (e theta - D)^-1,

Var[N(t)] = (lambda - 2 lambda^2 + 2 theta D1 tmp D1 e) t

  • 2 theta D1 tmp (I - exp(D t)) tmp D1 e,

from He and Neuts, "Markov chains with marked transitions" (1998).

ARITHMETIC: the linear part is rational in the entries, the transient correction needs exp(D t), so the function requires transcendental arithmetic. The two terms have opposite signs and nearly cancel for small t, where Var -> lambda t; that cancellation is the reason the high-precision backends are useful here.

map_varcount.m is the same quantity written with (e theta - D)^-2 in the middle instead of tmp on both sides. The two agree identically, because D (e theta) = (D e) theta = 0 and (e theta) D = e (theta D) = 0, so e theta and D commute and hence tmp commutes with exp(D t). Both spellings are ported (see map_varcount.h) and the tests assert their agreement.

Definition in file map_count_var.h.