SymbolicInference

Documentation for SymbolicInference.

See the RQA Moment-Based Hypothesis Testing Vignette for an illustrated guide to analytical RQA inference using marked Bivariate Generating Functions.

SymbolicInference.extract_recurrences — Method
extract_recurrences(data_source::Vector{Float64}, motifs_dict::Dict{String, Vector}; num_windows::Int64 = 3)

This function returns x and y coordinates for a given window considering start and size of each motif. The y coordinates are the values from data provided by the user.

source
SymbolicInference.extract_recurrences_cross — Method
extract_recurrences_cross(data_source::Vector{Float64}, data_source2::Vector{Float64},
    motifs_dict::Dict{String, Vector}; num_windows::Int64 = 3)

This function returns x and y coordinates for a given window considering start and size of each motif detected from two time-series in cross-recurrence matrices. The y coordinates are the values from data provided by the user.

source
SymbolicInference.extract_recurrences_joint — Method
extract_recurrences_joint(data_source::Vector{Float64}, data_source2::Vector{Float64},
    motifs_dict::Dict{String, Vector}; num_windows::Int64 = 3)

This function returns x and y coordinates for a given window considering start and size of each motif detected from two time-series in joint-recurrence matrices . The y coordinates are the values from data provided by the user.

source
SymbolicInference.persistence_barcode — Method
persistence_barcode(time_series1,time_series2; range = collect(0.1:0.1:0.9), n_windows=10,alpha_thresh=0.05)

Return barcode plot for each window. Points are plotted whenever the p-value is smaller than alpha_thresh.

source
SymbolicInference.persistence_barcode — Method
persistence_barcode(time_series; range = collect(0.1:0.1:0.9), n_windows=10,alpha_thresh=0.05)

Return barcode plot for each window. Points are plotted whenever the p-value is smaller than alpha_thresh.

source
SymbolicInference.plot_motifs — Method
plot_motifs(time_series::Vector{Float64},coordinates::Vector{Any}; plot_size=(2000, 1000), n_motifs=2)

Plot motifs from coordinates extracted with extract_recurrences.

source
SymbolicInference.plot_motifs_cross — Method
plot_motifs_cross(time_series::Vector{Float64},time_series2::Vector{Float64},
    coordinates::Vector{Any}; plot_size=(2000, 1000), n_motifs=2)

Plot motifs from coordinates extracted with extract_recurrences_cross.

source
SymbolicInference.plot_motifs_joint — Method
plot_motifs_joint(time_series::Vector{Float64},time_series2::Vector{Float64},
    coordinates::Vector{Any}; plot_size=(2000, 1000), n_motifs=2)

Plot motifs from coordinates extracted with extract_recurrences_joint.

source
SymbolicInference.plot_rqa_moments — Method
plot_rqa_moments(moments_dict::Dict{String, Any}; title_prefix="", plot_size=(1200, 480), z_thresh=1.96)

Plot the results of rqa_moments_test across off-diagonal windows:

  • Left panel: Observed statistic vs. exact analytical expected value $\mu_i$ and $\pm z_{\text{thresh}} \sigma_i$ null band.
  • Right panel: Standardized $Z$-scores per off-diagonal window along with the global aggregated $Z$-score and $p$-value.
source
SymbolicInference.rec_matrix_motifs — Method
rec_matrix_motifs(rec_matrix::Union{RecurrenceMatrix,CrossRecurrenceMatrix,JointRecurrenceMatrix};
                  seqs="recurrences", window_range=collect(1:6), n_motifs=2, verbose=false)

Returns set of probabilities associated with consecutive runs in off-diagonals.

Argument seqs sets the type of consecutive sequences: either 'double' (recurrences and non-recurrences), 'recurrences' or 'poincare' (non-recurrences). The diagonals given by window_range argument are considered, along with nmotifs for each diagonal. See `AnalyticComb.weightedbinrunsprob` for definition of symbolic construction.

source
SymbolicInference.rqa_moments_test — Method
rqa_moments_test(rec_matrix::Union{RecurrenceMatrix,CrossRecurrenceMatrix,JointRecurrenceMatrix};
                 lmin::Int=2, window_range=collect(1:6), seqs="recurrences", metric="determinism")

Perform analytical hypothesis testing on Recurrence Quantification Analysis (RQA) diagonal statistics using exact moments (mean, var, std) derived from Bivariate Generating Functions (BGFs) via AnalyticComb.weighted_bin_runs_moments.

Arguments

  • rec_matrix: A RecurrenceMatrix, CrossRecurrenceMatrix, or JointRecurrenceMatrix.
  • lmin::Int=2: Minimum run length threshold $l_{\min}$ (standard RQA default is 2).
  • window_range=collect(1:6): Off-diagonal window indices to evaluate.
  • seqs="recurrences": Sequence type ("recurrences" for 1-runs, "poincare" for 0-runs, or "double" for both).
  • metric="determinism":
    • "determinism" (or "length_ge"): Tests the total number of points in runs of length $\ge l_{\min}$ (the numerator of RQA Determinism $DET$).
    • "motif_count" (or "count_ge"): Tests the number of distinct diagonal lines (runs) of length $\ge l_{\min}$.
    • "exact_length" (or "count_eq"): Tests the count of diagonal lines of exact length $l_{\min}$ (line-length histogram $P(l_{\min})$).

Returns

A Dict{String, Any} containing:

  • "Window": Evaluated window_range
  • "Observed": Vector of observed statistics per diagonal
  • "Expected": Vector of exact analytical means $\mu_i$ per diagonal
  • "Std": Vector of exact analytical standard deviations $\sigma_i$ per diagonal
  • "ZScores": Vector of standardized $Z$-scores per diagonal
  • "PValues": Vector of one-sided upper-tail normal $p$-values per diagonal
  • "Global": A NamedTuple (observed, expected, var, std, z_score, p_value, p_value_twosided, chebyshev_bound, det_observed, det_expected) aggregating across all diagonals in window_range.
source