Skip to content

Reference

Two complementary references for the tsecon API.

API reference

The complete callable surface — every function's signature and one-line contract, generated directly from the type stub so it never drifts from the shipped module. Start here when you know the function and need its arguments.

Results objects

tsecon.results — an opt-in layer of dict subclasses that render themselves: .summary() output an economist can read, plus the standard plots. Because they subclass dict, the plain-dict contract every estimator already returns is preserved exactly; adopting them is additive.

Testing & validation

The single map of how the library is tested: ten tiers from Rust goldens to a published-result replication, what each can and cannot prove, the commands to run them, and an honest list of what is not covered. Start here if you are deciding whether to trust a number this library produced.

Validation matrix

What every method family is validated against — the reference implementation (statsmodels, SciPy, arch, linearmodels, scikit-learn, ArviZ) or the documented closed form, with the fixture, the test, and the tolerance for each. Correctness, made auditable. Its runtime companion is the Monte Carlo suite, which verifies the statistical properties (size, coverage, consistency) that a fixture match cannot.

Speed dashboard

The benchmark harness's output as a page: the cross-library parity matrix first (every operation tsecon and statsmodels/arch/SciPy/scikit-learn both compute, with the measured disagreement and the asserted tolerance), then the timings with the machine and build that produced them, then the commands that regenerate it. Rendered from a committed JSON, never typed by hand.

Model cards

One card per method family, each with the same anatomy: what it estimates · assumptions · when to use (and when not) · key arguments and defaults (and why) · how to read the output · failure modes · what it's validated against · references · a runnable example. Start here when you want to know whether a method fits your problem and how to trust its output.

Family Functions
Diagnostics acf, pacf, ljung_box, jarque_bera, arch_lm, adf, kpss, check_stationarity
Phillips-Perron & Ouliaris tests phillips_perron, phillips_ouliaris
Check series (one-call battery) check_series (plus the tsecon.results.check_series facade with .summary() / .plot_diagnostics())
ARIMA arima_fit, ar_loglik
Spectral analysis periodogram, welch, coherence
Volatility garch_fit, gas_volatility, dcs_local_level, ccc_garch, dcc_garch
VAR / SVAR var_fit, var_irf, var_irf_bands, var_fevd, var_granger, var_forecast, sign_restricted_svar, zero_sign_svar, favar, connectedness, var_girf
Structural identification (advanced) long_run_svar, max_share_svar, proxy_svar, hetero_svar
Local projections lp, lp_iv, lp_multiplier, lp_state, smooth_lp
Bayesian bvar_fit, bvar_hierarchical, bvar_ssvs, bvar_irf_draws, mcmc_diagnostics
GMM iv_gmm, gmm_nonlinear
Cointegration & regimes johansen, vecm, ou_fit, spread_zscore, markov_switching_ar, setar, setar_test, setar_threshold_ci, star, star_eval, star_test, threshold_vecm, hansen_seo_test, threshold_var, threshold_var_test, threshold_var_girf
Forecasting backtest, dm_test, cw_test, gw_test, theta_forecast, accuracy
Machine learning ridge, lasso, elastic_net, adaptive_lasso, lasso_path, cv_splits
Structured penalties & post-selection group_lasso, post_lasso, pds_lasso
Kernel methods kernel_ridge, kernel_regression
Regression trees & random forests regression_tree, random_forest
L1 trend filtering & boosting l1_trend_filter, boosting
Neural regressors mlp_regression, echo_state_network
Panel panel_fe, panel_distributed_lag, panel_lp, mean_group_var, panel_mean_group, panel_pmg
Panel unit-root tests panel_unit_root (LLC, IPS, Fisher/Maddala-Wu-Choi)
Nowcasting & MIDAS dfm_nowcast, dfm_news, midas_weights, umidas, weighted_midas
Term structure nelson_siegel, svensson, dynamic_ns, acm_term_premium, jsz_fit, jsz_loadings
Realized volatility realized_measures, har_rv, realized_quarticity, tripower_quarticity, bns_jump_test, realized_range
Predictive regressions & IVX predictive_regression, ivx_test
Recession probability recession_probit
Survey expectations cg_regression, forecast_efficiency, forecast_disagreement
Long memory frac_diff, frac_integrate, long_memory_d
Specification & diagnostic tests heteroskedasticity_test, reset_test, chow_test, cusum_test
Arbitrage-free Nelson-Siegel afns_adjustment
DSGE (linear RE solver) dsge_solve
Quantile regression & growth-at-risk quantile_regression, quantile_lp, growth_at_risk
Functional shocks (FVAR/FLP) functional_pca, flp, flp_scenario, fvar_scenario
Structural breaks bai_perron, sup_f_test
Static copulas pseudo_obs, copula_fit, copula_select
Cointegrating regressions (FM-OLS / DOLS / CCR) fmols, dols, ccr
VAR conditional forecasts & residual diagnostics var_conditional_forecast, var_diagnostics, var_select_order
Multiple forecast comparisons spa_test, stepm_test, model_confidence_set
Exponential smoothing (ETS) ets_fit, auto_ets
Structural time-series models (unobserved components) & TVP regression unobserved_components, tvp_regression