Class TraceAnalysisKt
-
- All Implemented Interfaces:
public final class TraceAnalysisKt
-
-
Method Summary
Modifier and Type Method Description final static Doubletrace_mean(DoubleArray S)Computes the mean of a trace. final static Doubletrace_var(DoubleArray S)Computes the variance of a trace. final static Doubletrace_scv(DoubleArray S)Computes the squared coefficient of variation (SCV) of a trace. final static DoubleArrayautocov(DoubleArray X)Computes the autocovariance of a trace using FFT. final static DoubleArraytrace_acf(DoubleArray S, IntArray lags)Computes the autocorrelation function (ACF) for a trace at specified lags. final static Doubletrace_acf(DoubleArray S)Computes the autocorrelation function at lag 1. final static Doubletrace_skew(DoubleArray S)Computes the bias-corrected skewness of a trace. final static Doubletrace_joint(DoubleArray S, IntArray lags, IntArray orders)Computes the joint moment EX^{k_1}_{i} X^{k_2}_{i+lag_1} ... final static Pair<DoubleArray, Array<IntArray>>trace_bicov(DoubleArray S, IntArray grid)Computes the bicovariance of a trace for a grid of lags. final static DoubleArraytrace_idi(DoubleArray S, IntArray kset)Computes the index of dispersion for intervals (IDI) of a trace. final static Doubletrace_idi(DoubleArray S)Computes the index of dispersion for intervals with default k values. final static Doubletrace_idc(DoubleArray S)Computes the index of dispersion for counts (IDC) of a trace. final static Doubletrace_gamma(DoubleArray T, Integer limit)Estimates the autocorrelation decay rate of a trace. final static DoubleArraytrace_shuffle(DoubleArray S)Shuffles a trace randomly. final static IntArraytrace_iat2counts(DoubleArray S, Double scale)Computes the counting process from inter-arrival times. final static Pair<IntArray, IntArray>trace_iat2bins(DoubleArray S, Double scale)Computes binned counts from inter-arrival times. final static Pair<DoubleArray, DoubleArray>trace_pmf(DoubleArray X)Computes the probability mass function of discrete values in a trace. final static TraceSummarytrace_summary(DoubleArray m)Computes comprehensive summary statistics for a trace. final static DoubleArraymtrace_mean(List<DoubleArray> traces)Computes the mean of multiple traces (multi-trace mean). -
-
Method Detail
-
trace_mean
final static Double trace_mean(DoubleArray S)
Computes the mean of a trace.
- Parameters:
S- Input trace- Returns:
Mean value
-
trace_var
final static Double trace_var(DoubleArray S)
Computes the variance of a trace.
- Parameters:
S- Input trace- Returns:
Variance
-
trace_scv
final static Double trace_scv(DoubleArray S)
Computes the squared coefficient of variation (SCV) of a trace.
- Parameters:
S- Input trace- Returns:
Squared coefficient of variation (variance / mean^2)
-
autocov
final static DoubleArray autocov(DoubleArray X)
Computes the autocovariance of a trace using FFT.
- Parameters:
X- Input trace (column vector conceptually)- Returns:
Autocovariance vector
-
trace_acf
final static DoubleArray trace_acf(DoubleArray S, IntArray lags)
Computes the autocorrelation function (ACF) for a trace at specified lags.
- Parameters:
S- Input tracelags- Lags at which to compute ACF (1-based in MATLAB, converted to 0-based internally)- Returns:
Autocorrelation values at specified lags
-
trace_acf
final static Double trace_acf(DoubleArray S)
Computes the autocorrelation function at lag 1.
- Parameters:
S- Input trace- Returns:
Lag-1 autocorrelation
-
trace_skew
final static Double trace_skew(DoubleArray S)
Computes the bias-corrected skewness of a trace.
- Parameters:
S- Input trace- Returns:
Skewness value
-
trace_joint
final static Double trace_joint(DoubleArray S, IntArray lags, IntArray orders)
Computes the joint moment EX^{k_1}_{i} X^{k_2}_{i+lag_1} ... for a trace.
- Parameters:
S- Input tracelags- Array of lag values (cumulative)orders- Array of moment orders for each position- Returns:
Joint moment value
-
trace_bicov
final static Pair<DoubleArray, Array<IntArray>> trace_bicov(DoubleArray S, IntArray grid)
Computes the bicovariance of a trace for a grid of lags.
- Parameters:
S- Input tracegrid- Lag values for bicovariance grid- Returns:
Pair of (bicovariance values, lag pairs)
-
trace_idi
final static DoubleArray trace_idi(DoubleArray S, IntArray kset)
Computes the index of dispersion for intervals (IDI) of a trace.
- Parameters:
S- Input trace (inter-arrival times)kset- Array of k values at which to compute IDI- Returns:
Array of IDI values
-
trace_idi
final static Double trace_idi(DoubleArray S)
Computes the index of dispersion for intervals with default k values.
- Parameters:
S- Input trace- Returns:
IDI value at k = min(1000, trace_length/30)
-
trace_idc
final static Double trace_idc(DoubleArray S)
Computes the index of dispersion for counts (IDC) of a trace. Asymptotically, IDI and IDC are equal.
- Parameters:
S- Input trace- Returns:
IDC value
-
trace_gamma
final static Double trace_gamma(DoubleArray T, Integer limit)
Estimates the autocorrelation decay rate of a trace.
- Parameters:
T- Input tracelimit- Maximum lag considered (default: 1000)- Returns:
Autocorrelation decay rate gamma
-
trace_shuffle
final static DoubleArray trace_shuffle(DoubleArray S)
Shuffles a trace randomly.
- Parameters:
S- Input trace- Returns:
Shuffled trace
-
trace_iat2counts
final static IntArray trace_iat2counts(DoubleArray S, Double scale)
Computes the counting process from inter-arrival times. Returns the number of arrivals within 'scale' time units from each arrival.
- Parameters:
S- Inter-arrival timesscale- Time window size- Returns:
Counts array
-
trace_iat2bins
final static Pair<IntArray, IntArray> trace_iat2bins(DoubleArray S, Double scale)
Computes binned counts from inter-arrival times.
- Parameters:
S- Inter-arrival timesscale- Bin width- Returns:
Pair of (counts per bin, bin membership for each event)
-
trace_pmf
final static Pair<DoubleArray, DoubleArray> trace_pmf(DoubleArray X)
Computes the probability mass function of discrete values in a trace.
- Parameters:
X- Input trace with discrete values- Returns:
Pair of (PMF values, unique values)
-
trace_summary
final static TraceSummary trace_summary(DoubleArray m)
Computes comprehensive summary statistics for a trace.
- Parameters:
m- Input trace- Returns:
TraceSummary containing all computed statistics
-
mtrace_mean
final static DoubleArray mtrace_mean(List<DoubleArray> traces)
Computes the mean of multiple traces (multi-trace mean).
- Parameters:
traces- List of traces- Returns:
Array of means for each trace
-
-
-
-