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

Class-pair covariance matrices of a marked trace. More...

#include <cstddef>
#include <vector>
#include "line/api/trace/trace_types.h"
#include "line/num/number.h"
#include "line/util/error.h"
#include "line/util/matrix.h"
Include dependency graph for mtrace_cov.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::trace

Functions

template<class T>
std::vector< std::vector< Matrix< T > > > line::trace::mtrace_cov (const std::vector< T > &Tv, const std::vector< int > &A)
 Class-pair covariance matrices of a marked trace.

Detailed Description

Class-pair covariance matrices of a marked trace.

For every ordered pair (c1,c2) the two masked series

X0(i) = T_i if A_i = c1 else 0, X1(i) = T_{i+1} if A_{i+1} = c2 else 0, i = 1..N-1,

are formed and their 2x2 sample covariance matrix (denominator N-2, i.e. MATLAB's cov on N-1 observations) is returned.

Templated port of matlab/lib/m3a/m3a/mtrace/mtrace_cov.m, cross-checked against jar/src/main/java/jline/api/trace/Mtrace_cov.java (identical, including the unbiased denominator and the indexing of classes by the raw label 1..max(A) rather than by position in unique(A)).

ARITHMETIC: sample second moments, exact in Rational.

Definition in file mtrace_cov.h.