![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Classes | |
| struct | MtraceBootstrapResult |
| Lower and upper BCa endpoints of each descriptor, and the point estimate. More... | |
| struct | MtraceCountResult |
| Return value of mtrace_count. More... | |
| struct | MtraceCountsResult |
| Return value of mtrace_iat2counts. More... | |
| struct | MtraceCrossMomentResult |
| Return value of mtrace_cross_moment. More... | |
| struct | MtraceJointResult |
| Return value of mtrace_joint. More... | |
| struct | MtraceMeanResult |
| Return value of mtrace_mean. More... | |
| struct | MtraceMergeResult |
| Return value of mtrace_merge, mirroring [T, L]. More... | |
| struct | MtraceSplitResult |
| Return value of mtrace_split. More... | |
| struct | MtraceSummary |
| Return value of mtrace_summary. More... | |
| struct | TraceBicovResult |
| Return value of trace_bicov, mirroring [BiCov, BiCovLags]. More... | |
| struct | TraceBinsResult |
| Return value of trace_iat2bins, mirroring [C, bC]. More... | |
| struct | TraceGammaResult |
| Return value of trace_gamma, mirroring [GAMMA, RHO0, RESIDUALS]. More... | |
| struct | TraceIdiResult |
| Return value of trace_idi, mirroring [IDIk, support]. More... | |
| struct | TracePmfResult |
| Return value of trace_pmf, mirroring [pmf, px]. More... | |
| struct | TraceSummary |
| Return value of trace_summary. More... | |
Functions | |
| template<class T> | |
| std::vector< T > | autocov (const std::vector< T > &S) |
| Sample autocovariance sequence of a trace, lags 0 . | |
| template<class T> | |
| Matrix< T > | mtrace_backward_moment (const std::vector< T > &Tv, const std::vector< int > &A, const std::vector< unsigned > &orders, bool norm=true) |
| Backward moments of a marked trace: the moments of the inter-arrival time that PRECEDES an event of each class, B(c,k) = (1/N) sum_{i: A_i = c} T_i^k, normalized by N/count_c when norm is set, so that M_k = sum_c B(c,k) p_c. | |
| template<class T> | |
| MtraceBootstrapResult< T > | mtrace_bootstrap (const std::vector< T > &Tv, const std::vector< int > &A, pfqn::McRng &rng, std::size_t resamples=1000, double alpha=0.05, std::size_t blockLen=50) |
| Block-bootstrap confidence intervals for the descriptors of a marked trace. | |
| template<class T> | |
| MtraceCountResult< T > | mtrace_count (const std::vector< T > &Tv, const std::vector< int > &A, const T &t) |
| Per-class count process of a marked trace on a fixed resolution: the number of events of each class in the successive windows of length t that start at the first arrival epoch. | |
| template<class T> | |
| std::vector< std::vector< Matrix< T > > > | mtrace_cov (const std::vector< T > &Tv, const std::vector< int > &A) |
| Class-pair covariance matrices of a marked trace. | |
| template<class T> | |
| MtraceCrossMomentResult< T > | mtrace_cross_moment (const std::vector< T > &Tv, const std::vector< int > &L, unsigned k) |
| Class-pair cross moments of a marked trace: the k-th moment of the interval that separates an event of class i from the next event, of class j, MC(i,j) = mean{ T_t^k : A_{t-1} = i, A_t = j }. | |
| template<class T> | |
| Matrix< T > | mtrace_forward_moment (const std::vector< T > &Tv, const std::vector< int > &A, const std::vector< unsigned > &orders, bool norm=true) |
| Forward moments of a marked trace: the moments of the inter-arrival time that FOLLOWS an event of each class, F(c,k) = (1/(N-1)) sum_{i<N: A_i = c} T_{i+1}^k, normalized by N/count_c when norm is set, so that M_k = sum_c F(c,k) p_c. | |
| template<class T> | |
| MtraceCountsResult< T > | mtrace_iat2counts (const std::vector< T > &Tv, const std::vector< int > &A, const T &scale) |
| Per-class counting processes of a marked trace: for each arrival, how many events of each class fall in the window of length scale that starts at that arrival. | |
| template<class T> | |
| MtraceJointResult< T > | mtrace_joint (const std::vector< T > &Tv, const std::vector< int > &A, unsigned i1, unsigned i2) |
| Class-dependent joint moments of a marked trace, JM(a) = (1/N_a) sum_{j : A_{j+1} = a} T_j^{i1} T_{j+1}^{i2}, the empirical estimate of E[(X_j)^{i1} (X_{j+1})^{i2}] conditioned on the middle event being of class a; the sum runs over the interior events, so the first and last event of the trace are excluded. | |
| template<class T> | |
| MtraceMeanResult< T > | mtrace_mean (const std::vector< T > &Tv, long ntypes, const std::vector< int > &type) |
| Per-type sample mean of a trace. | |
| template<class T> | |
| MtraceMergeResult< T > | mtrace_merge (const std::vector< T > &t1, const std::vector< T > &t2) |
| Superposes two single-class traces into one marked trace, labelling the events of the first stream 1 and those of the second 2. | |
| template<class T> | |
| Matrix< T > | mtrace_moment (const std::vector< T > &Tv, const std::vector< int > &A, const std::vector< unsigned > &orders, bool after=false, bool norm=false) |
| Empirical class-dependent moments of a marked trace. | |
| template<class T> | |
| MtraceCrossMomentResult< T > | mtrace_moment_simple (const std::vector< T > &Tv, const std::vector< int > &L, unsigned k) |
| template<class T> | |
| std::vector< T > | mtrace_pc (const std::vector< int > &A) |
| Class probabilities of a marked trace, p_c = count_c / N. | |
| template<class T> | |
| Matrix< T > | mtrace_sigma (const std::vector< int > &L) |
| One-step class transition frequencies of a marked trace, sigma(i,j) = #{t : A_t = i, A_{t+1} = j} / (N-1). | |
| template<class T> | |
| Matrix< T > | mtrace_sigma2 (const std::vector< int > &L) |
| Two-step class transition frequencies of a marked trace, sigma(i,j,h) = #{t : A_t = i, A_{t+1} = j, A_{t+2} = h} / (N-2). | |
| template<class T> | |
| MtraceSplitResult< T > | mtrace_split (const std::vector< T > &Tv, const std::vector< int > &L) |
| Splits a marked trace into its per-class traces: for each class, the inter-arrival times BETWEEN CONSECUTIVE EVENTS OF THAT CLASS, with the first interval measured from the origin. | |
| template<class T> | |
| MtraceSummary< T > | mtrace_summary (const std::vector< T > &Tv, const std::vector< int > &A, int max_lag=100) |
| Descriptor set of a marked trace: the first five raw moments of the inter-arrival times, the autocorrelation function, the first two forward and backward moments, the first two class-pair cross moments, the class probabilities and the one-step class transition frequencies. | |
| template<class T> | |
| std::vector< T > | mtrace_var (const std::vector< T > &tv, std::size_t ntypes, const std::vector< int > &types) |
| Per-class variance of a marked trace. | |
| template<class T> | |
| std::vector< T > | trace_acf (const std::vector< T > &S, const std::vector< int > &lags) |
| Autocorrelation coefficients of a trace at the requested lags. | |
| template<class T> | |
| std::vector< T > | trace_acf (const std::vector< T > &S) |
| Lag-1 autocorrelation, the MATLAB and JAR default. | |
| template<class T> | |
| TraceBicovResult< T > | trace_bicov (const std::vector< T > &S, const std::vector< int > &grid) |
| Bicovariance of a trace on a lag grid. | |
| template<class T> | |
| TraceGammaResult< T > | trace_gamma (const std::vector< T > &S, long limit=1000, const std::vector< T > &grid=std::vector< T >()) |
| Autocorrelation decay rate of a trace: the gamma of the geometric model rho(k) = rho0 * gamma^k, with rho0 = (1 - 1/scv)/2 fixed by the second moment and gamma fitted by least squares on the empirical acf. | |
| template<class T> | |
| TraceBinsResult | trace_iat2bins (const std::vector< T > &S, const T &scale) |
| Bins a trace on a fixed time grid: the number of arrivals falling in each interval ((i-1)*scale, i*scale], and the bin index of each arrival. | |
| template<class T> | |
| std::vector< long > | trace_iat2counts (const std::vector< T > &S, const T &scale) |
| Counting process of a trace: the number of arrivals in the window of length scale that starts at each arrival epoch. | |
| template<class T> | |
| T | trace_idc (const std::vector< T > &S) |
| Index of dispersion for counts, estimated by its asymptotic equality with the index of dispersion for intervals at a large aggregation level. | |
| template<class T> | |
| TraceIdiResult< T > | trace_idi (const std::vector< T > &S, const std::vector< long > &k_set, long aggregate_n=0, bool drop_trailing_zero=false) |
| Index of dispersion for intervals, IDI(k) = k * var(S_t + ... + S_{t+k-1}) / mean(S_t + ... + S_{t+k-1})^2, the standard burstiness descriptor of Sriram and Whitt (JSAC 6, 1986). | |
| template<class T> | |
| T | trace_joint (const std::vector< T > &S, const std::vector< int > &lag, const std::vector< unsigned > &order) |
| Joint moments of a trace, E[X_i^{k_1} X_{i+l_2}^{k_2} ...]. | |
| template<class T> | |
| T | trace_mean (const std::vector< T > &S) |
| (1/n) sum_i S(i). | |
| template<class T> | |
| TracePmfResult< T > | trace_pmf (const std::vector< int > &X) |
| Empirical probability mass function of a discrete trace (counts, batch sizes, queue-length samples). | |
| template<class T> | |
| T | trace_scv (const std::vector< T > &S, bool unbiased=true) |
| Squared coefficient of variation of a trace, var/mean^2. | |
| template<class T, class Gen> | |
| std::vector< T > | trace_shuffle (const std::vector< T > &S, Gen &gen) |
| A uniformly random permutation of the samples, drawn with the given engine. | |
| template<class T> | |
| T | trace_skew (const std::vector< T > &S) |
| Bias-corrected sample skewness (MATLAB's skewness(S,0), equivalently the G1 estimator). | |
| template<class T> | |
| TraceSummary< T > | trace_summary (const std::vector< T > &S) |
| Descriptive summary of a trace: moments, shape, order statistics, autocorrelation and burstiness. | |
| template<class T> | |
| T | trace_var (const std::vector< T > &S, bool unbiased=true) |
| Sample variance of a trace. | |
| std::vector< T > line::trace::autocov | ( | const std::vector< T > & | S | ) |
Sample autocovariance sequence of a trace, lags 0 .
. n-2.
Definition at line 46 of file autocov.h.
References autocov(), line::InputError::InputError(), and trace_mean().
Referenced by autocov(), and trace_acf().
| Matrix< T > line::trace::mtrace_backward_moment | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| const std::vector< unsigned > & | orders, | ||
| bool | norm = true ) |
Backward moments of a marked trace: the moments of the inter-arrival time that PRECEDES an event of each class, B(c,k) = (1/N) sum_{i: A_i = c} T_i^k, normalized by N/count_c when norm is set, so that M_k = sum_c B(c,k) p_c.
| Tv | inter-arrival times |
| A | class labels |
| orders | moment orders |
| norm | normalize by N/count_c (the MATLAB default) |
Definition at line 59 of file mtrace_backward_moment.h.
References mtrace_backward_moment(), and mtrace_moment().
Referenced by line::mam::mamap22_fit_gamma_bs_trace(), line::mam::mamap2m_fit_gamma_fb_trace(), line::mam::mamap2m_fit_trace(), line::mam::maph2m_fit_trace(), mtrace_backward_moment(), and mtrace_summary().
| MtraceBootstrapResult< T > line::trace::mtrace_bootstrap | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| pfqn::McRng & | rng, | ||
| std::size_t | resamples = 1000, | ||
| double | alpha = 0.05, | ||
| std::size_t | blockLen = 50 ) |
Block-bootstrap confidence intervals for the descriptors of a marked trace.
| Tv | inter-arrival times |
| A | class labels, one per arrival |
| rng | generator, advanced by the call |
| resamples | number of bootstrap replicates; the reference default is 1000 |
| alpha | two-sided level; 0.05 gives a 95% interval |
| blockLen | target block length; the reference uses 50 |
Definition at line 137 of file mtrace_bootstrap.h.
References line::trace::MtraceBootstrapResult< T >::blocks, line::trace::MtraceBootstrapResult< T >::estimate, line::InputError::InputError(), line::trace::MtraceBootstrapResult< T >::lower, line::pfqn::mc_uniform01(), mtrace_bootstrap(), line::sim::sim_normcdf(), line::sim::sim_norminv(), and line::trace::MtraceBootstrapResult< T >::upper.
Referenced by mtrace_bootstrap().
| MtraceCountResult< T > line::trace::mtrace_count | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| const T & | t ) |
Per-class count process of a marked trace on a fixed resolution: the number of events of each class in the successive windows of length t that start at the first arrival epoch.
| Tv | inter-arrival times |
| A | class labels |
| t | window length (the resolution) |
Definition at line 65 of file mtrace_count.h.
References line::trace::MtraceCountResult< T >::counts, line::InputError::InputError(), line::trace::MtraceCountResult< T >::labels, and mtrace_count().
Referenced by mtrace_count().
| 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.
| Tv | inter-arrival times |
| A | class labels, positive |
Definition at line 48 of file mtrace_cov.h.
References line::InputError::InputError(), and mtrace_cov().
Referenced by mtrace_cov().
| MtraceCrossMomentResult< T > line::trace::mtrace_cross_moment | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | L, | ||
| unsigned | k ) |
Class-pair cross moments of a marked trace: the k-th moment of the interval that separates an event of class i from the next event, of class j, MC(i,j) = mean{ T_t^k : A_{t-1} = i, A_t = j }.
| Tv | inter-arrival times |
| L | class labels |
| k | moment order |
Definition at line 56 of file mtrace_cross_moment.h.
References line::trace::MtraceCrossMomentResult< T >::count, line::Matrix< T >::Matrix(), line::trace::MtraceCrossMomentResult< T >::mc, mtrace_cross_moment(), and line::num_pow_int().
Referenced by line::mam::mmap_mixture_fit_trace(), mtrace_cross_moment(), mtrace_moment_simple(), and mtrace_summary().
| Matrix< T > line::trace::mtrace_forward_moment | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| const std::vector< unsigned > & | orders, | ||
| bool | norm = true ) |
Forward moments of a marked trace: the moments of the inter-arrival time that FOLLOWS an event of each class, F(c,k) = (1/(N-1)) sum_{i<N: A_i = c} T_{i+1}^k, normalized by N/count_c when norm is set, so that M_k = sum_c F(c,k) p_c.
| Tv | inter-arrival times |
| A | class labels |
| orders | moment orders |
| norm | normalize by N/count_c (the MATLAB default) |
Definition at line 53 of file mtrace_forward_moment.h.
References mtrace_forward_moment(), and mtrace_moment().
Referenced by line::mam::mamap22_fit_gamma_fs_trace(), line::mam::mamap2m_fit_gamma_fb_trace(), line::mam::mamap2m_fit_trace(), mtrace_forward_moment(), and mtrace_summary().
| MtraceCountsResult< T > line::trace::mtrace_iat2counts | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| const T & | scale ) |
Per-class counting processes of a marked trace: for each arrival, how many events of each class fall in the window of length scale that starts at that arrival.
| Tv | inter-arrival times |
| A | class labels |
| scale | window length |
Definition at line 69 of file mtrace_iat2counts.h.
References line::trace::MtraceCountsResult< T >::counts, line::InputError::InputError(), line::trace::MtraceCountsResult< T >::labels, and mtrace_iat2counts().
Referenced by line::mam::m3pp2m_fitc_trace(), line::mam::m3pp_superpos_fitc_trace(), and mtrace_iat2counts().
| MtraceJointResult< T > line::trace::mtrace_joint | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| unsigned | i1, | ||
| unsigned | i2 ) |
Class-dependent joint moments of a marked trace, JM(a) = (1/N_a) sum_{j : A_{j+1} = a} T_j^{i1} T_{j+1}^{i2}, the empirical estimate of E[(X_j)^{i1} (X_{j+1})^{i2}] conditioned on the middle event being of class a; the sum runs over the interior events, so the first and last event of the trace are excluded.
| Tv | inter-event times |
| A | class labels, positive |
| i1 | exponent of the first interval |
| i2 | exponent of the second interval |
Definition at line 61 of file mtrace_joint.h.
References line::trace::MtraceJointResult< T >::count, line::InputError::InputError(), line::trace::MtraceJointResult< T >::jm, mtrace_joint(), and line::num_pow_int().
Referenced by mtrace_joint().
| MtraceMeanResult< T > line::trace::mtrace_mean | ( | const std::vector< T > & | Tv, |
| long | ntypes, | ||
| const std::vector< int > & | type ) |
Per-type sample mean of a trace.
| Tv | the trace |
| ntypes | number of types |
| type | type of each sample, in 0..ntypes-1 |
Definition at line 50 of file mtrace_mean.h.
References line::trace::MtraceMeanResult< T >::count, line::InputError::InputError(), line::trace::MtraceMeanResult< T >::mean, and mtrace_mean().
Referenced by mtrace_mean().
| MtraceMergeResult< T > line::trace::mtrace_merge | ( | const std::vector< T > & | t1, |
| const std::vector< T > & | t2 ) |
Superposes two single-class traces into one marked trace, labelling the events of the first stream 1 and those of the second 2.
| t1 | inter-arrival times of the first trace |
| t2 | inter-arrival times of the second trace |
Definition at line 53 of file mtrace_merge.h.
References line::InputError::InputError(), line::trace::MtraceMergeResult< T >::labels, mtrace_merge(), and line::trace::MtraceMergeResult< T >::times.
Referenced by mtrace_merge().
| Matrix< T > line::trace::mtrace_moment | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| const std::vector< unsigned > & | orders, | ||
| bool | after = false, | ||
| bool | norm = false ) |
Empirical class-dependent moments of a marked trace.
| Tv | inter-arrival times |
| A | class labels |
| orders | moment orders |
| after | false for Horvath variables, true for Buchholz variables |
| norm | true to normalize by N/count_c |
Definition at line 65 of file mtrace_moment.h.
References line::InputError::InputError(), mtrace_moment(), and line::num_pow_int().
Referenced by mtrace_backward_moment(), mtrace_forward_moment(), and mtrace_moment().
| MtraceCrossMomentResult< T > line::trace::mtrace_moment_simple | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | L, | ||
| unsigned | k ) |
Definition at line 36 of file mtrace_moment_simple.h.
References mtrace_cross_moment(), and mtrace_moment_simple().
Referenced by mtrace_moment_simple().
| std::vector< T > line::trace::mtrace_pc | ( | const std::vector< int > & | A | ) |
Class probabilities of a marked trace, p_c = count_c / N.
Templated port of matlab/lib/m3a/m3a/mtrace/mtrace_pc.m, cross-checked against jar/src/main/java/jline/api/trace/Mtrace_pc.java (identical).
| A | class labels; |
Definition at line 42 of file mtrace_pc.h.
References line::InputError::InputError(), and mtrace_pc().
Referenced by line::mam::mamap22_fit_gamma_bs_trace(), line::mam::mamap22_fit_gamma_fs_trace(), line::mam::mamap2m_fit_gamma_fb_trace(), line::mam::mamap2m_fit_trace(), line::mam::maph2m_fit_trace(), mtrace_pc(), and mtrace_summary().
| Matrix< T > line::trace::mtrace_sigma | ( | const std::vector< int > & | L | ) |
One-step class transition frequencies of a marked trace, sigma(i,j) = #{t : A_t = i, A_{t+1} = j} / (N-1).
| L | class labels; |
Definition at line 42 of file mtrace_sigma.h.
References line::InputError::InputError(), and mtrace_sigma().
Referenced by line::mam::mamap22_fit_gamma_bs_trace(), line::mam::mamap22_fit_gamma_fs_trace(), line::mam::mamap2m_fit_trace(), mtrace_sigma(), and mtrace_summary().
| Matrix< T > line::trace::mtrace_sigma2 | ( | const std::vector< int > & | L | ) |
Two-step class transition frequencies of a marked trace, sigma(i,j,h) = #{t : A_t = i, A_{t+1} = j, A_{t+2} = h} / (N-2).
| L | class labels; |
Definition at line 43 of file mtrace_sigma2.h.
References line::InputError::InputError(), and mtrace_sigma2().
Referenced by line::mam::mmap_mixture_fit_trace(), and mtrace_sigma2().
| MtraceSplitResult< T > line::trace::mtrace_split | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | L ) |
Splits a marked trace into its per-class traces: for each class, the inter-arrival times BETWEEN CONSECUTIVE EVENTS OF THAT CLASS, with the first interval measured from the origin.
| Tv | inter-arrival times of the marked process |
| L | class labels |
Definition at line 52 of file mtrace_split.h.
References line::trace::MtraceSplitResult< T >::labels, mtrace_split(), and line::trace::MtraceSplitResult< T >::traces.
Referenced by mtrace_split().
| MtraceSummary< T > line::trace::mtrace_summary | ( | const std::vector< T > & | Tv, |
| const std::vector< int > & | A, | ||
| int | max_lag = 100 ) |
Descriptor set of a marked trace: the first five raw moments of the inter-arrival times, the autocorrelation function, the first two forward and backward moments, the first two class-pair cross moments, the class probabilities and the one-step class transition frequencies.
| Tv | inter-arrival times |
| A | class labels |
| max_lag | largest acf lag (100 in both references) |
Definition at line 73 of file mtrace_summary.h.
References line::trace::MtraceSummary< T >::acf, line::trace::MtraceSummary< T >::B1, line::trace::MtraceSummary< T >::B2, line::trace::MtraceSummary< T >::C1, line::trace::MtraceSummary< T >::C2, line::trace::MtraceSummary< T >::F1, line::trace::MtraceSummary< T >::F2, line::trace::MtraceSummary< T >::M, mtrace_backward_moment(), mtrace_cross_moment(), mtrace_forward_moment(), mtrace_pc(), mtrace_sigma(), mtrace_summary(), line::num_pow_int(), line::trace::MtraceSummary< T >::Pab, line::trace::MtraceSummary< T >::Pc, and trace_acf().
Referenced by mtrace_summary().
| std::vector< T > line::trace::mtrace_var | ( | const std::vector< T > & | tv, |
| std::size_t | ntypes, | ||
| const std::vector< int > & | types ) |
Per-class variance of a marked trace.
| tv | the trace values |
| ntypes | number of classes |
| types | 0-based class label of each value |
Definition at line 47 of file mtrace_var.h.
References line::InputError::InputError(), and mtrace_var().
Referenced by mtrace_var().
| std::vector< T > line::trace::trace_acf | ( | const std::vector< T > & | S | ) |
Lag-1 autocorrelation, the MATLAB and JAR default.
Definition at line 76 of file trace_acf.h.
References trace_acf().
| std::vector< T > line::trace::trace_acf | ( | const std::vector< T > & | S, |
| const std::vector< int > & | lags ) |
Autocorrelation coefficients of a trace at the requested lags.
| S | the trace |
| lags | the lags to evaluate; entries outside (0, n-2] are dropped |
Definition at line 57 of file trace_acf.h.
References autocov(), line::NumericError::NumericError(), and trace_acf().
Referenced by mtrace_summary(), trace_acf(), trace_acf(), trace_gamma(), and trace_summary().
| TraceBicovResult< T > line::trace::trace_bicov | ( | const std::vector< T > & | S, |
| const std::vector< int > & | grid ) |
Bicovariance of a trace on a lag grid.
| S | the trace |
| grid | the lag values swept in both positions |
Definition at line 50 of file trace_bicov.h.
References line::trace::TraceBicovResult< T >::bicov, line::trace::TraceBicovResult< T >::lags, trace_bicov(), and trace_joint().
Referenced by trace_bicov().
| TraceGammaResult< T > line::trace::trace_gamma | ( | const std::vector< T > & | S, |
| long | limit = 1000, | ||
| const std::vector< T > & | grid = std::vector<T>() ) |
Autocorrelation decay rate of a trace: the gamma of the geometric model rho(k) = rho0 * gamma^k, with rho0 = (1 - 1/scv)/2 fixed by the second moment and gamma fitted by least squares on the empirical acf.
| S | the trace |
| limit | largest lag considered (the JAR default is 1000) |
| grid | candidate decay rates; the JAR grid 0.990..0.999 by default |
Definition at line 73 of file trace_gamma.h.
References line::trace::TraceGammaResult< T >::gamma, line::InputError::InputError(), line::num_pow_int(), line::NumericError::NumericError(), line::trace::TraceGammaResult< T >::residuals, line::trace::TraceGammaResult< T >::rho0, trace_acf(), trace_gamma(), and trace_scv().
Referenced by line::mam::amap2_fit_gamma_trace(), line::mam::mamap22_fit_gamma_bs_trace(), line::mam::mamap22_fit_gamma_fs_trace(), line::mam::mamap2m_fit_gamma_fb_trace(), line::mam::mamap2m_fit_trace(), and trace_gamma().
| TraceBinsResult line::trace::trace_iat2bins | ( | const std::vector< T > & | S, |
| const T & | scale ) |
Bins a trace on a fixed time grid: the number of arrivals falling in each interval ((i-1)*scale, i*scale], and the bin index of each arrival.
| S | inter-arrival times |
| scale | bin width |
Definition at line 53 of file trace_iat2bins.h.
References line::trace::TraceBinsResult::counts, line::InputError::InputError(), line::trace::TraceBinsResult::membership, and trace_iat2bins().
Referenced by trace_iat2bins().
| std::vector< long > line::trace::trace_iat2counts | ( | const std::vector< T > & | S, |
| const T & | scale ) |
Counting process of a trace: the number of arrivals in the window of length scale that starts at each arrival epoch.
| S | inter-arrival times |
| scale | window length |
Definition at line 51 of file trace_iat2counts.h.
References line::InputError::InputError(), and trace_iat2counts().
Referenced by trace_iat2counts().
| T line::trace::trace_idc | ( | const std::vector< T > & | S | ) |
Index of dispersion for counts, estimated by its asymptotic equality with the index of dispersion for intervals at a large aggregation level.
| S | the trace; the aggregation level is min(1000, ceil(n/30)). |
Definition at line 44 of file trace_idc.h.
References line::trace::TraceIdiResult< T >::idi, trace_idc(), and trace_idi().
Referenced by trace_idc(), and trace_summary().
| TraceIdiResult< T > line::trace::trace_idi | ( | const std::vector< T > & | S, |
| const std::vector< long > & | k_set, | ||
| long | aggregate_n = 0, | ||
| bool | drop_trailing_zero = false ) |
Index of dispersion for intervals, IDI(k) = k * var(S_t + ... + S_{t+k-1}) / mean(S_t + ... + S_{t+k-1})^2, the standard burstiness descriptor of Sriram and Whitt (JSAC 6, 1986).
| k_set | aggregation levels |
| aggregate_n | 0 for raw samples; n > 0 when S is already the sum of n inter-arrivals, which uses k/n windows (MATLAB's 'aggregate' option) |
| drop_trailing_zero | true removes the spurious zero sample described above; false (default) reproduces the references |
| S | the interarrival-time trace |
Definition at line 71 of file trace_idi.h.
References line::trace::TraceIdiResult< T >::idi, line::InputError::InputError(), line::NumericError::NumericError(), line::trace::TraceIdiResult< T >::support, trace_idi(), trace_mean(), and trace_var().
Referenced by trace_idc(), and trace_idi().
| T line::trace::trace_joint | ( | const std::vector< T > & | S, |
| const std::vector< int > & | lag, | ||
| const std::vector< unsigned > & | order ) |
Joint moments of a trace, E[X_i^{k_1} X_{i+l_2}^{k_2} ...].
| S | the trace |
| lag | lag increments; cumulated and shifted to start at 0 |
| order | the exponent of each factor, same length as lag |
Definition at line 53 of file trace_joint.h.
References line::InputError::InputError(), line::num_pow_int(), and trace_joint().
Referenced by trace_bicov(), and trace_joint().
| T line::trace::trace_mean | ( | const std::vector< T > & | S | ) |
(1/n) sum_i S(i).
Definition at line 31 of file trace_mean.h.
References trace_mean().
Referenced by autocov(), trace_idi(), trace_mean(), trace_scv(), trace_skew(), trace_summary(), and trace_var().
| TracePmfResult< T > line::trace::trace_pmf | ( | const std::vector< int > & | X | ) |
Empirical probability mass function of a discrete trace (counts, batch sizes, queue-length samples).
| X | the discrete trace. |
Definition at line 54 of file trace_pmf.h.
References line::InputError::InputError(), line::trace::TracePmfResult< T >::pmf, trace_pmf(), and line::trace::TracePmfResult< T >::values.
Referenced by trace_pmf().
| T line::trace::trace_scv | ( | const std::vector< T > & | S, |
| bool | unbiased = true ) |
Squared coefficient of variation of a trace, var/mean^2.
| S | the trace |
| unbiased | variance denominator, see trace_var |
Definition at line 39 of file trace_scv.h.
References line::NumericError::NumericError(), trace_mean(), trace_scv(), and trace_var().
Referenced by trace_gamma(), trace_scv(), and trace_summary().
| 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.
Definition at line 36 of file trace_shuffle.h.
References line::InputError::InputError(), and trace_shuffle().
Referenced by trace_shuffle().
| T line::trace::trace_skew | ( | const std::vector< T > & | S | ) |
Bias-corrected sample skewness (MATLAB's skewness(S,0), equivalently the G1 estimator).
| S | the trace, at least 3 samples. |
Definition at line 48 of file trace_skew.h.
References line::InputError::InputError(), line::NumericError::NumericError(), trace_mean(), and trace_skew().
Referenced by trace_skew(), and trace_summary().
| TraceSummary< T > line::trace::trace_summary | ( | const std::vector< T > & | S | ) |
Descriptive summary of a trace: moments, shape, order statistics, autocorrelation and burstiness.
| S | the trace, at least 6 samples so that the lag-4 acf exists. |
Definition at line 103 of file trace_summary.h.
References line::trace::TraceSummary< T >::acf, line::trace::TraceSummary< T >::idc, line::trace::TraceSummary< T >::idc_scv_ratio, line::InputError::InputError(), line::trace::TraceSummary< T >::iqr, line::trace::TraceSummary< T >::kurt_excess, line::trace::TraceSummary< T >::mad, line::trace::TraceSummary< T >::max, line::trace::TraceSummary< T >::mean, line::trace::TraceSummary< T >::min, line::num_abs(), line::NumericError::NumericError(), line::trace::TraceSummary< T >::p95, line::trace::TraceSummary< T >::q25, line::trace::TraceSummary< T >::q50, line::trace::TraceSummary< T >::q75, line::trace::TraceSummary< T >::scv, line::trace::TraceSummary< T >::skew, trace_acf(), trace_idc(), trace_mean(), trace_scv(), trace_skew(), trace_summary(), and trace_var().
Referenced by trace_summary().
| T line::trace::trace_var | ( | const std::vector< T > & | S, |
| bool | unbiased = true ) |
Sample variance of a trace.
| S | the trace |
| unbiased | true for the n-1 denominator (MATLAB var), false for the n denominator (the JAR, and the lag-0 autocovariance) |
Definition at line 45 of file trace_var.h.
References line::InputError::InputError(), trace_mean(), and trace_var().
Referenced by trace_idi(), trace_scv(), trace_summary(), and trace_var().