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

Random permutation of a trace. More...

#include <algorithm>
#include <cstddef>
#include <numeric>
#include <random>
#include <vector>
#include "line/util/error.h"
Include dependency graph for trace_shuffle.h:

Go to the source code of this file.

Namespaces

namespace  line
namespace  line::trace

Functions

template<class T, class Gen>
std::vector< T > line::trace::trace_shuffle (const std::vector< T > &S, Gen &gen)
 A uniformly random permutation of the samples, drawn with the given engine.

Detailed Description

Random permutation of a trace.

Templated port of matlab/lib/kpctoolbox/trace/trace_shuffle.m.

Shuffling destroys the autocorrelation while leaving every marginal moment untouched, which is what makes it the null model for a correlation test: any statistic that moves under a shuffle is reading the ORDER of the trace, not its distribution. Callers that want an uncorrelated trace with the same marginal use this rather than resampling, because resampling would perturb the empirical moments as well.

Definition in file trace_shuffle.h.