Fidelity & departures¶
dplPy is a port. Its goal is to reproduce the methods of the established dendrochronology tools — primarily dplR, and, where relevant, COFECHA, ARSTAN, and CRUST — so that results are comparable across ecosystems. This page explains what "reproduce" means here, how it is checked, and the places where dplPy deliberately departs from its references.
The principle¶
Two commitments guide the port:
- Where dplPy claims to reproduce a reference method, that claim is checked against the reference implementation — not from memory or documentation, but against the actual source.
- Every deliberate departure is documented at the point it occurs (in the relevant function's docstring) and summarized here.
In 2026 the crossdating and standardization stack was put through a systematic fidelity audit: every behavioral constant and every "matches dplR / COFECHA / ARSTAN" claim in the source was verified against the authoritative references — the dplR 1.8.0 R sources, the CRUST Fortran (Melvin & Briffa), and the COFECHA Fortran. Unsourced constants were removed or documented, and overstated claims were corrected.
A note on precision¶
Reproducing a method is not the same as being bit-identical to a compiled Fortran program. For pure-Python ports of dplR routines, dplPy follows dplR's algorithm step for step. For the COFECHA and ARSTAN emulations, dplPy reproduces the headline numbers closely (see Crossdating: dplR vs COFECHA) but will not match the original binaries to the last digit — the reference programs themselves differ from run to run and version to version. dplPy's documentation avoids claiming a numerical precision it cannot demonstrate.
Documented departures¶
These are the places where dplPy intentionally differs from dplR (or from the tool it is emulating). None is accidental; each is chosen and documented.
| Area | Departure | Why |
|---|---|---|
| Crossdating B flag | xdate flags a segment "B" when its correlation is higher at a non-dated lag. dplR 1.8.0's corr.rwl.seg runs the same lag search (lag.max, best.lag/best.rho) and plot.crs tints lag segments, but keeps its returned flags significance-only; dplPy promotes that lag result to an explicit B flag, active in both the default and the COFECHA preset. |
COFECHA's lag-shift information is useful; it is provided in both modes by design. |
| Floating-series match | xdate_floater selects the best placement by the highest t statistic; dplR's xdate.floater uses the highest correlation r. dplPy also omits dplR's future-year trim. |
t accounts for the degrees of freedom at each overlap (e.g. Wilson 2026). |
RCS / SSF preset="crust" |
A minimum curve-value floor of 0.02 is applied. This comes from CRUST (Melvin & Briffa 2014), not from dplR's rcs/ssf. |
It reproduces the CRUST behavior the preset is meant to emulate. |
chron_ars ARSTAN chronology |
The ars column defaults to ars_method="arstan": the residual chronology is re-reddened with the pooled AR coefficients (ARSTAN's albino1 then commie1, and the development version of dplR since October 2026), whereas released dplR up to 1.8.0 re-reddens each series and then averages. ars_method="dplr" restores that order. Re-reddening initials follow ARSTAN's bckcst, not dplR's postAR. |
chron_ars emulates ARSTAN, so its ARSTAN chronology follows Ed Cook's Fortran. The two constructions diverge under changing sample depth (ca533: max difference about 0.25). |
stabilize_chron / stabilize= rescaling |
The stabilized chronology is restandardized to the input's full-period mean and SD, not to a user-chosen reference period as in ARSTAN's stabbm. |
Keeps the stabilized chronology on the same overall scale as the input without requiring a reference-period choice, while the time-varying variance is still removed. |
powt power vs ARSTAN |
The adaptive power is fit by regressing log(spread) on log(level) across adjacent rings. dplPy (following dplR) uses the pair mean (x[t]+x[t-1])/2 as the level and applies p = |1-b| unclamped; ARSTAN's option 4 uses the trailing ring x[t] as the level and clamps p to [0, 1]. |
dplPy reproduces dplR's powt exactly (its primary reference); a series' power can therefore differ slightly from ARSTAN's. |
| AR order selection | autoreg, ar_func and every prewhiten=True path fit Yule-Walker AR models (as R's ar() does) but choose the order at the first local AIC minimum with a cap of ar_max=10 (first_aic_min=True), the ARSTAN/COFECHA rule. R's ar() and dplR take the global AIC minimum up to 10·log10(n). |
One package-wide prewhitening default, matching the Fortran programs dplPy emulates. first_aic_min=False (and ar_max=None where offered) reproduce R's choice. |
detrend negative spline period |
A negative spline_period is read as a percent spline (|spline_period|/100 × n). |
The ARSTAN convention. dplR simply rejects non-positive stiffness. |
writers |
Interior gaps indicated by a negative default value of -99 on write, a dplPy convention but similar to other applications), and the default precision is 0.001 (dplR defaults to 0.01). |
This convention is explicit, human-readable, and reversible. |
readers |
Anomalous negative values (but not the -9999 stop marker) are set to NaN with a warning rather than silently altered; *-noaa.rwl template files are rejected with an informative error. |
Ring widths cannot be negative and negative values (except the stop value) are meant to indicate gaps in the data. |
Where to look¶
Each function's docstring states its reference and any departure; the API Reference surfaces those docstrings directly. The crossdating method families — the largest and most consequential area of emulation — have their own page: Crossdating: dplR vs COFECHA. The works behind these methods are collected in References.