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

Descriptive summary of a trace: moments, shape, order statistics, autocorrelation and burstiness. More...

#include <algorithm>
#include <cstddef>
#include <vector>
#include "line/api/trace/trace_acf.h"
#include "line/api/trace/trace_idc.h"
#include "line/api/trace/trace_mean.h"
#include "line/api/trace/trace_scv.h"
#include "line/api/trace/trace_skew.h"
#include "line/api/trace/trace_types.h"
#include "line/api/trace/trace_var.h"
#include "line/num/number.h"
#include "line/util/error.h"
Include dependency graph for trace_summary.h:

Go to the source code of this file.

Classes

struct  line::trace::TraceSummary< T >
 Return value of trace_summary. More...

Namespaces

namespace  line
namespace  line::trace

Functions

template<class T>
TraceSummary< T > line::trace::trace_summary (const std::vector< T > &S)
 Descriptive summary of a trace: moments, shape, order statistics, autocorrelation and burstiness.

Detailed Description

Descriptive summary of a trace: moments, shape, order statistics, autocorrelation and burstiness.

Templated port of jar/src/main/java/jline/api/trace/Trace_var.java#trace_summary, cross-checked against matlab/lib/kpctoolbox/trace/trace_summary.m. The MATLAB version prints its result to a file id and returns the same quantities as separate outputs; the JAR returns them packed in a vector. This port returns a struct, so nothing is printed and nothing is positional.

DIVERGENCES, MATLAB vs JAR, resolved as follows:

  • MAD: MATLAB uses mad(m,1), the median absolute deviation about the median. The JAR sorts the absolute deviations and takes element n/2, which is the upper median for even n and is not the median at all when n is even. MATLAB is the reference; the true median is used here.
  • KURT: the JAR subtracts 3, MATLAB's kurtosis does not. The field is named kurt_excess to make the convention explicit; add 3 for MATLAB.
  • SCV / IDC: the JAR uses the population variance everywhere, MATLAB the unbiased one; MATLAB is the reference (see trace_var.h).
  • percentiles: the linear-interpolation ("type 7") rule of the JAR is used. MATLAB's prctile interpolates on the (i-0.5)/n grid ("type 5") and gives different values on short traces; both agree in the limit.

ARITHMETIC: the skewness and the standard deviation take square roots. static_assert(num_traits<T>::has_transcendental)

Definition in file trace_summary.h.