Repository navigation
Methods
This folder is the rigorous mathematical reference for everything dtfit
ships: each method's grounding in differential (non-Taylor) transformations,
the full algorithm, the numerical optimizations and guards in the implementation,
and where it is best applied. It is the deepest of the three doc layers -- for
plain-language intuition see ../guides/, and for exact call signatures
see ../api/.
Every batch method page carries a figure of one fit, and the measured comparisons are the experiment notebooks' -- see reproducing the tables.
dtfit is organized as one principle (match a signal's image, the
discrete differential transform of its samples) realized across four
execution tiers -- symbolic reference, batch, streaming, and
batch-at-scale -- plus a high-level composition layer that routes to the
right variant automatically.
| tier | method | doc | runtime path | role |
|---|---|---|---|---|
| reference | DSB -- Differential Spectra Balance | dsb.md | symbolic (offline) | analytical ground truth / derivation |
| core | Image -- the discrete differential transform | image.md | numeric (offline) | the statistic every batch method fits on |
| batch | LSI -- Least-Squares Integral | lsi.md | numeric (offline) | accurate batch fit in the Legendre image, model selection, oscillatory recipe |
| batch | EAC -- Equal-Areas Criterion | eac.md | numeric (offline) | fast batch fit in the block image, the robust image |
| streaming | ImageFilter(basis="block") -- recursive EAC | equal_areas_filter.md | numeric (online) | real-time tracking via an area measurement + drift detection |
| streaming | ImageFilter(basis="legendre") -- recursive LSI | legendre_filter.md | numeric (online) | real-time tracking via a spectrum measurement (oscillatory plants) |
| scale | ImageStream -- streams, blocks, channels | scaling.md | numeric (offline/online) | one-pass / block / many-channel image map-reduce |
| compose | auto_forecast | auto.md | numeric (offline) | structured fit-then-extrapolate forecasting |
| stochastic | Stochastic series -- fit the functionals of a random process | stochastic.md | numeric (offline + online) | characterize / forecast / generate / track random (economic, financial) data |
The production methods (LSI, EAC, the filters, ImageStream) are numeric successors to the symbolic originals (DSBI -> LSI, DSBE -> EAC). DSB is kept as the analytical reference. The split follows the dissertation's hard requirement that the runtime path carry no unbounded symbolic solve -- SymPy is allowed only once, offline, at derivation/initialization time. (For the full lineage -- which method came from which, and how the variants differ -- see ../guides/lineage-and-variants.md.)
All methods operate on the differential spectrum of a signal rather than on
its samples directly. For an analytic function
where
So
The numeric methods compute this on the finite sample, not the infinite
Taylor series above: the image (Methods-Image) is the
discrete differential transform of a signal in a basis at a finite order, a
fixed-size statistic built directly from (x, y) that every batch method --
LSI, EAC, the filters, ImageStream -- fits on.
The classical motivation is that elementary functions have closed-form discretes -- you never truncate an infinite Taylor series for them:
| term | discrete |
|---|---|
| constant |
|
|
|
|
A transcendental model such as
Implementation note. dtfit does not maintain this table in code. In a
spectra balance every equation matches model and data discretes at the same
order _symbolic.py), which
both reproduces the table above and extends the scheme to any differentiable
model (rational, logarithmic, mixed) without a per-function rule. The numeric
methods go further and replace the monomial spectrum with a better-conditioned
orthogonal-polynomial spectrum (LSI).
differential spectrum X(k) = (H^k/k!) x^(k)(0)
|
+--------------+---------------+----------------+------------------+
| | | | |
exact balance weighted-L2 integral / area additive over compose /
F(k;theta)=Z(k) of spectra matching domain & channels route
| | | | |
DSB LSI EAC ImageStream auto_forecast
(symbolic (Legendre image (block image (streams, blocks, (structured
solve) residual) residual) channels, map-reduce) forecasting)
| |
run recursively, one sample at a time
| |
ImageFilter(basis="legendre") ImageFilter(spectrum meas., basis="block") (area meas.)
- DSB sets the empirical spectrum (from a polynomial pre-fit) equal to the symbolic model spectrum, discrete by discrete, and solves the algebraic system -- exact when well-posed, but symbolic and noise-sensitive.
- LSI relaxes the exact balance to a weighted integral least-squares discrepancy of the two spectra on an orthogonal basis -- numeric, noise-tolerant, accurate; with an oscillatory recipe.
- EAC matches integrals (areas) of model and data over windows rather than spectra -- local equations and a diagonal Gram; the robust image is the outlier defense, in either basis.
-
ImageFilter(basis="block") / ImageFilter(basis="legendre") run EAC / LSI recursively, one sample at a time,
through a shared
ImageFilter, with drift detection and a calibratedresult(); summing several filters'nis_pools their innovations into one fused fault test (FilterBankandFusedChiSquareDetectorare the experimental multi-stream harness, not part of this table). - ImageStream exploits that the image is additive (so a stream reduces chunk-by-chunk, and blocks assemble through the basis transfer) and linear across channels (so many channels share one Gram) -- exact batch fitting at scale.
-
auto_forecast routes a series to the model class its structure calls for,
composing only the validated levers; a parameter fit needs no router --
fit(..., basis="auto")picks the basis by outcome.
The differential-transformation framing is native to the Pukhov school and largely invisible in the Western literature, so each batch method is restated here in the vocabulary a Western reviewer knows. The two production fitters are the two faces of one weighted-residual (Galerkin) identification:
| dtfit method | classical identity | classical relatives (same goal, different route) |
|---|---|---|
| EAC (area matching) | Galerkin with piecewise-constant Haar test functions; the overdetermined four-windows-per-parameter form is an over-identified method of moments (GMM) | Prony / Matrix-Pencil / ESPRIT (algebraic pole recovery), variable projection |
| LSI (orthogonal-basis spectral match) | a spectral ( |
classical method of moments (the monomial form is LSI's ill-conditioned ancestor), variable projection, Prony/ESPRIT for cycles |
So EAC and LSI are the
The experiments are Jupyter notebooks in the separate dtfit-experimental
package (install with pip install -e "packages/dtfit-experimental[bench]").
A notebook is the experiment and its report, and re-running it reproduces its
tables and figures:
python -m dtfit_experimental.study.download_data # fetch the public datasets (once)
jupyter nbconvert --to notebook --execute --inplace \
packages/dtfit-experimental/experiments/method/15_families.ipynbThe figures on the method pages are illustrations of one fit each. The
notebooks, the datasets and a summary of each result are indexed on
the experiments page; the adaptations in trial and the
established baselines each method is measured against are documented in
../experimental/. Baselines include SciPy curve_fit
(Levenberg-Marquardt NLS, the gold standard), robust NLLS, numpy.polyfit, a
Gaussian process, ARIMA/ETS/Theta, MLP/LSTM nets, an EKF, RLS and a
constant-acceleration Kalman filter -- plus the Western parameter-estimation
lineage (Prony, Matrix-Pencil / ESPRIT, variable projection, method of moments)
and a classical-estimator twin of the stochastic model (ADF / OLS /
periodogram / DFA / GARCH-QMLE), so the differential-transformation route is
compared against the textbook toolkit it is meant to improve on.
Published automatically from the repo's wiki/ directory by the wiki workflow. All pages are maintained directly in wiki/.
Start here
Guides
Examples
- Overview
- 01 Quickstart
- 02 Fitting methods
- 03 Models & auto
- 04 sklearn estimator
- 05 Streaming
- 06 Scaling
- 07 Diagnostics
- 08 Stochastic
API reference
Methods (math)
Experimental
Validation