model.fit_aging_curve()

Fit a weighted quadratic in centered form.

Usage

model.fit_aging_curve(
    df,
    y_col,
    weight_col,
    age_col="Age",
    center=30.0,
)

Model: y = A + B·(Age − center) + C·(Age − center)² + ε

The centered parameterization gives each coefficient an interpretable meaning at Age = center:

  • A — predicted y_col at the centering age (default 30).
  • B — slope at the centering age.
  • C — curvature (negative for a true peak; the more negative, the sharper the peak and the steeper the post-peak decline).

With C < 0 the closed-form peak and max are:

  • peak_age = center − B / (2·C)
  • max_value = A − B² / (4·C)

Returns None when fewer than 3 non-null rows are available.