Skip to main content

Analysis Flows Reference

Framework: alphaswarm_docs/analysis-framework.md · UI: alphaswarm_docs/analysis-lab.md.

Every flow in the registry. Each flow is identified by a namespaced name (namespace.flow), declares a Pydantic params model, and returns a FlowResult with metrics / rows / chart / optional arrow_table for Iceberg persistence.

GET /analysis/flows lists every entry with the JSON-schema body derived from the params model — the lab UI auto-renders forms from this surface.

profiling.*

NameLabelNotes
profiling.describeColumn profileWraps alphaswarm.data.profiling.compute_profile
profiling.dtypesDtypesPer-column dtype + memory footprint
profiling.null_auditNull auditNull counts + null fractions
profiling.topkTop-K valuesMost-frequent values + share

distribution.*

NameLabelNotes
distribution.descriptive_statsDescriptive statsMean / median / std / skew / kurt / IQR / MAD / quantiles
distribution.histogramHistogramEqual-width bins + Plotly chart
distribution.ecdfEmpirical CDFSorted-value ECDF (down-sampled to max_points)
distribution.qq_plot_pointsQ-Q plot pointsSlope/intercept fit vs. norm/t/uniform/expon
distribution.shapiro_wilkShapiro-WilkNormality test (capped at 5000 samples)
distribution.jarque_beraJarque-BeraSkew + kurt goodness-of-fit
distribution.kolmogorov_smirnovK-SOne-sample vs reference dist (norm / t / uniform / expon / lognorm)

outlier.*

NameLabelNotes
outlier.zscoreZ-scoreRobust (median/MAD) or classical
outlier.iqrIQR fencesTukey [Q1 - kIQR, Q3 + kIQR]
outlier.iforestIsolation Forestsklearn
outlier.dbscanDBSCANDensity-based; -1 is noise
outlier.lofLOFsklearn LocalOutlierFactor
outlier.ecodECODPyOD; falls back to z-score
outlier.pulse_vs_stepPulse vs StepDistinguish transient pulses from level shifts

imputation.*

NameLabelNotes
imputation.ffill_bfillForward / backward fillDefault ffill_then_bfill
imputation.linearLinear interpolationpandas axis=0
imputation.splineCubic splinepandas spline (order configurable)
imputation.knnKNN imputersklearn KNNImputer
imputation.miceMICE (IterativeImputer)sklearn IterativeImputer

regression.*

NameLabelNotes
regression.ols_diagnosticsOLS diagnosticsCoefs + SE + t / p + Durbin-Watson + AIC / BIC
regression.white_testWhite's testHeteroskedasticity (general form)
regression.breusch_paganBreusch-PaganHeteroskedasticity vs regressors
regression.vifVIFVariance Inflation Factors per regressor

time_series.*

NameLabelNotes
time_series.stlSTL decompositionTrend / seasonal / residual
time_series.adfAugmented Dickey-FullerH0 = unit root
time_series.kpssKPSSH0 = stationary (ADF complement)
time_series.acf_pacfACF / PACFAuto- and partial-autocorrelation series
time_series.garchGARCH(p, q)Volatility model + horizon variance forecast
time_series.change_pointChange-pointruptures.KernelCPD with rbf kernel
time_series.granger_causalityGranger causalityUp to max_lag
time_series.cointegrationEngle-GrangerPair cointegration
time_series.spectral_fftSpectral (FFT)Real FFT magnitude + power spectrum
time_series.spectral_waveletContinuous wavelet transformPyWavelets (optional)
time_series.hurst_exponentHurst exponentLong-range dependence
time_series.theil_senTheil-Sen slopeRobust median-of-pairwise-slopes

derivatives.*

NameLabelNotes
derivatives.bsmBlack-Scholes-MertonClosed-form European price + Greeks
derivatives.greeks_surfaceGreeks surfaceΔ/Γ/ν/Θ/ρ across strikes × expiries
derivatives.implied_volatilityImplied volatility (Brent)Recover σ from a market quote
derivatives.monte_carlo_europeanMC European optionVectorised GBM; opt-in CUDA via cupy
derivatives.monte_carlo_barrierMC barrier optionKnock-in / knock-out variants
derivatives.monte_carlo_asianMC Asian optionArithmetic / geometric averaging
derivatives.sabr_smileSABR smile (Hagan)Hagan-Kumar-Lesniewski-Woodward 2002
derivatives.bachelierBachelier (normal model)Wraps alphaswarm.options.normal_model

portfolio.*

NameLabelNotes
portfolio.markowitz_efficient_frontierEfficient frontiercvxpy if available, numpy-only fallback
portfolio.ledoit_wolf_shrinkageLedoit-Wolf covarianceStabilised covariance matrix
portfolio.fama_french_5_rollingFF5 rolling betasRolling-window OLS on Mkt-RF / SMB / HML / RMW / CMA
portfolio.risk_parityRisk parityEqual-risk-contribution weights (Spinu 2013)

factors.*

NameLabelNotes
factors.evaluateFactor evaluationWraps alphaswarm.data.factors.evaluate_factor (IC + quantile spread + turnover)

microstructure.*

NameLabelNotes
microstructure.realised_volatilityRealised volatility (OHLC)Close-to-close / Parkinson / GK / RS / YZ
microstructure.order_book_imbalanceOrder-book imbalanceTop-of-book
microstructure.vpinVPINWraps alphaswarm.data.microstructure.vpin

Optional dependencies

Flows tag their optional deps (optional_dependencies field on the descriptor). Missing extras raise a friendly RuntimeError("install extra X") instead of crashing the catalog.

DepUsed by
scikit-learnoutlier.{iforest,dbscan,lof}, imputation.{knn,mice}, portfolio.ledoit_wolf_shrinkage
statsmodelsregression.*, time_series.{adf,kpss,acf_pacf,granger_causality,cointegration,stl}
archtime_series.garch
rupturestime_series.change_point
pywaveletstime_series.spectral_wavelet
pyodoutlier.ecod (falls back to z-score)
cvxpyportfolio.markowitz_efficient_frontier (falls back to numpy projection)
cupyderivatives.monte_carlo_* (opt-in GPU acceleration)