chaotic_pfc.analysis.stats¶
Statistical analysis of Lyapunov sweep results.
Provides quick programmatic access to the full sweep dataset: summary tables, regime classification, parameter ranking, and comparisons across windows, filter types, and Kaiser beta sweeps.
Return types¶
All public functions that return dict have corresponding
TypedDict definitions in this module so that IDE
autocompletion and mypy can statically verify the result shape:
SummaryRow— one row ofsummary_table()FilterTypeAggregate— output ofcompare_filter_types()OptimalParams— one entry ofoptimal_parameters()LmaxDistribution— output oflmax_distribution()CorrelationMatrix— output ofcorrelation_matrix()BootstrapConfidence— one entry ofbootstrap_confidence()
Functions
|
Rank sweeps by percentage of chaotic grid points (descending). |
|
Return (betas, pct_chaotic) arrays for a single filter type. |
|
Aggregate per-β statistics for each filter type. |
|
Bootstrap 95% CI for mean λ_max per filter type. |
|
For each order, compute the width of the chaotic region in cutoff space. |
|
Aggregate statistics per filter type across all windows. |
|
Spearman correlation between (order, cutoff, λ_max) across all sweeps. |
|
Write the full summary table to a JSON file. |
|
Histogram of λ_max values per filter type. |
|
Find the (order, cutoff) pairs with the highest λ_max. |
|
Return one row per sweep with key statistics. |
|
Find the cutoff where each order transitions from non-chaotic to chaotic. |
Classes
Bootstrap 95% CI entry for one filter type. |
|
Spearman correlation results from |
|
Aggregate statistics for a single filter type. |
|
Distribution statistics for lambda_max per filter type. |
|
One optimal (order, cutoff) pair from |
|
One row of |
- class chaotic_pfc.analysis.stats.SummaryRow[source]¶
Bases:
TypedDictOne row of
summary_table().
- class chaotic_pfc.analysis.stats.FilterTypeAggregate[source]¶
Bases:
TypedDictAggregate statistics for a single filter type.
- class chaotic_pfc.analysis.stats.OptimalParams[source]¶
Bases:
TypedDictOne optimal (order, cutoff) pair from
optimal_parameters().
- class chaotic_pfc.analysis.stats.LmaxDistribution[source]¶
Bases:
TypedDictDistribution statistics for lambda_max per filter type.
- class chaotic_pfc.analysis.stats.CorrelationMatrix[source]¶
Bases:
TypedDictSpearman correlation results from
correlation_matrix().
- class chaotic_pfc.analysis.stats.BootstrapConfidence[source]¶
Bases:
TypedDictBootstrap 95% CI entry for one filter type.
- chaotic_pfc.analysis.stats.summary_table(data_dir='data/sweeps')[source]¶
Return one row per sweep with key statistics.
Each row is a
SummaryRowwith:window,filter_type,n_orders,n_cutoffs,pct_chaotic,pct_periodic,pct_divergent,mean_lmax,max_lmax,beta(Kaiser only).This is the foundation of all downstream analyses — every other public function in this module either calls or derives from this table.
- chaotic_pfc.analysis.stats.best_chaos_preserving(data_dir='data/sweeps', top_n=5)[source]¶
Rank sweeps by percentage of chaotic grid points (descending).
Returns the top_n entries with the most chaotic coverage.
- chaotic_pfc.analysis.stats.compare_filter_types(data_dir='data/sweeps')[source]¶
Aggregate statistics per filter type across all windows.
Returns a
dictkeyed by filter type ("lowpass", …) with each value being aFilterTypeAggregatecontaining mean percentages and lambda_max across all windows that use that filter type.
- chaotic_pfc.analysis.stats.optimal_parameters(data_dir='data/sweeps', window=None, filter_type=None, top_n=3)[source]¶
Find the (order, cutoff) pairs with the highest λ_max.
Filters results by window and filter_type if given.
- chaotic_pfc.analysis.stats.export_summary_json(data_dir='data/sweeps', output='data/analysis_summary.json')[source]¶
Write the full summary table to a JSON file.
- chaotic_pfc.analysis.stats.beta_summary(data_dir='data/sweeps/kaiser')[source]¶
Aggregate per-β statistics for each filter type.
Returns a nested dict:
{filter_type: {beta: {pct_chaotic, mean_lmax, ...}}}
- chaotic_pfc.analysis.stats.beta_curve(data_dir='data/sweeps/kaiser', filter_type='lowpass')[source]¶
Return (betas, pct_chaotic) arrays for a single filter type.
Useful for plotting the β-dependence of chaotic coverage.
- chaotic_pfc.analysis.stats.lmax_distribution(data_dir='data/sweeps', bins=50)[source]¶
Histogram of λ_max values per filter type.
- chaotic_pfc.analysis.stats.transition_boundary(data_dir='data/sweeps', window=None, filter_type='lowpass')[source]¶
Find the cutoff where each order transitions from non-chaotic to chaotic.
For each order, returns the first cutoff (lowest frequency) where λ_max > 0, or NaN if no chaotic point exists.
- chaotic_pfc.analysis.stats.chaos_margin(data_dir='data/sweeps', window=None, filter_type='lowpass')[source]¶
For each order, compute the width of the chaotic region in cutoff space.
- chaotic_pfc.analysis.stats.correlation_matrix(data_dir='data/sweeps')[source]¶
Spearman correlation between (order, cutoff, λ_max) across all sweeps.