femic.pipeline.vdyp_curves

Reusable VDYP curve smoothing/fitting helpers.

Functions

build_observed_bins_for_fit(*, ...[, bin_years])

Build time-aggregated observed medians used for NLLS/tail fitting.

detect_linear_tail_segment(*, observed_age, ...)

Detect a straight-ish right-tail segment by scanning bins from right to left.

fill_curve_left(x, y, *, curve_fit_fn, ...)

Fill left tail with a toe-fit curve and return fitted arrays plus toe metadata.

legacy_fit_func1(x, a, b, c, s)

Legacy body/toe fit function used in notebook-era curve smoothing.

legacy_fit_func1_bounds_func(x)

Bounds function for legacy_fit_func1 with c capped by min(x) and 100.

legacy_fit_func2(x, a, b)

Legacy splice-fit function used for left-tail blending diagnostics.

legacy_fit_func2_bounds_func(_x)

Bounds function for legacy_fit_func2.

prepend_quasi_origin_point(x, y, *[, age, ...])

Ensure curves are anchored at quasi-origin (age, epsilon).

process_vdyp_out(vdyp_out, *, curve_fit_fn, ...)

Build smoothed VDYP curve with toe splice and quasi-origin fallback behavior.