Skip to main content

Crate tsorder_core

Crate tsorder_core 

Source
Expand description

§tsorder-core

Dependency-free core for time-series order selection.

Two families of estimators live here, deliberately sharing one data path (sample autocovariance → Levinson–Durbin recursion):

  • Classical information criteria (ic_order): AIC, AICc, BIC, HQ, FPE, evaluated over nested AR fits of order 0..=max_order.
  • Fine–Hwang threshold estimators (fh_order): fit a model whose memory p_n grows with n, “clip” every statistic below a vanishing threshold η_n, and report the index of the last surviving lag. Several pluggable statistics are supported (Statistic).

The mathematical background, the equivalences between the two families and the empirical findings that motivated the design are summarised on the project page: https://castlaboratory.github.io/tsorder/.

All functions take &[f64], never allocate more than O(n + K^2), and are no_std-friendly in spirit (they use Vec but nothing else from std).

Re-exports§

pub use acov::acf;
pub use acov::autocovariance;
pub use arma::hannan_rissanen;
pub use arma::HrConfig;
pub use arma::HrResult;
pub use cancorr::canonical_correlations;
pub use cancorr::canonical_correlations_from_acov;
pub use cancorr::canonical_correlations_stacked;
pub use cancorr::svc_order;
pub use cancorr::Cancorr;
pub use cancorr::SvcConfig;
pub use cancorr::SvcPenalty;
pub use cancorr::SvcResult;
pub use criteria::ic_order;
pub use criteria::ic_order_with;
pub use criteria::Criterion;
pub use criteria::IcMethod;
pub use criteria::IcResult;
pub use dist::chi2_sf;
pub use dist::df_tau_c_critical;
pub use dist::imhof_sf;
pub use dist::kpss_critical;
pub use dist::satterthwaite_sf;
pub use eacf::eacf;
pub use eacf::EacfConfig;
pub use eacf::EacfResult;
pub use hankel::hankel_rank_order;
pub use hankel::hankel_svt_order;
pub use hankel::HankelRankConfig;
pub use hankel::HankelRankResult;
pub use hankel::HankelSvtConfig;
pub use hankel::HankelSvtResult;
pub use hankel::RankAlpha;
pub use hankel::RankPvalue;
pub use integration::integration_order;
pub use integration::IntegrationConfig;
pub use integration::IntegrationResult;
pub use integration::UnitRootTest;
pub use levinson::burg_from_series;
pub use levinson::levinson;
pub use levinson::levinson_from_series;
pub use levinson::Levinson;
pub use robust::qn;
pub use robust::robust_autocorrelation;
pub use robust::robust_autocovariance;
pub use robust::shrink_to_psd;
pub use select::ensemble_order;
pub use select::EnsembleResult;
pub use select::EnsembleRule;
pub use select::fh_order;
pub use select::FhConfig;
pub use select::FhResult;
pub use select::Statistic;
pub use select::jirak_order;
pub use select::JirakConfig;
pub use select::JirakResult;
pub use threshold::polylog_memory;
pub use threshold::power_memory;
pub use threshold::Memory;
pub use threshold::Threshold;

Modules§

acov
Sample autocovariance / autocorrelation.
arma
Hannan–Rissanen (1982) recursive ARMA order selection and initial coefficient estimation (their stages 1–2; the efficient third stage is left to the bindings/estimation layer).
cancorr
Canonical correlations between the past and the future of a stationary series — the weighted (CCA) subspace step of Bauer (2001). The number of non-zero canonical correlations is the state dimension (McMillan degree), which is what the SVC criterion and the Gumbel-thresholded variant read off the estimated correlations.
criteria
Classical information criteria over nested AR fits.
dist
Distribution functions for the rank tests: chi-square survival and the law of a weighted sum of independent χ²₁ variables (the null of the Baram–Porat / Robin–Smith statistics), by Imhof’s (1961) exact inversion or Satterthwaite’s two-moment approximation.
eacf
Extended sample autocorrelation function (Tsay & Tiao 1984) and the triangle-vertex identification of ARMA(p, q).
hankel
McMillan degree by singular-value thresholding of the Hankel matrix of sample autocovariances (M3 route 2).
integration
Order of integration d by sequential unit-root testing with a vanishing level: difference until the test stops indicating a unit root, with α_n → 0 so the number of differences is estimated consistently.
levinson
Levinson–Durbin recursion: Yule–Walker AR fits of every order 1..=K in O(K²), yielding the PACF and the innovation variance of each order.
linalg
Minimal dense linear algebra (Cholesky) for the OLS long-AR path. Kept tiny on purpose; the core has no external dependencies.
robust
Robust scale and autocovariance estimation.
select
Fine–Hwang threshold estimators with pluggable statistics, plus an ensemble.
sim
Simulation utilities for tests and benchmarks (feature sim).
threshold
Vanishing thresholds τ_n and growing memory p_n for Fine–Hwang estimators.

Enums§

Error
Library error type.

Type Aliases§

Result