growthcurves.fit module

Contents

growthcurves.fit module#

Entry point of growthcurves package

growthcurves.fit.fit_model(t: ndarray, N: ndarray, model_name: str, lag_threshold: float = 0.15, exp_threshold: float = 0.15, phase_boundary_method=None, **kwargs) tuple[dict, dict][source]#

Fit a growth model to the provided t and N.

Parameters:
  • t (np.ndarray) – Time points corresponding to N (in hours).

  • N (np.ndarray) – Growth data points corresponding to t.

  • model_name (str) – One of the models in mech_logistic, mech_gompertz, mech_richards, mech_baranyi, phenom_logistic, phenom_gompertz, phenom_gompertz_modified, phenom_richards, spline, sliding_window.

  • lag_threshold (float, optional) – Fraction of μ_max to define end of lag phase (threshold method, default: 0.15).

  • exp_threshold (float, optional) – Fraction of μ_max to define end of exponential phase (threshold method, default: 0.15).

  • phase_boundary_method (str, optional) – Method to determine phase boundaries (“tangent”, “threshold”, or None for default for model class).

  • **kwargs – Additiona keyword arguments to be passed to fitting and inference functions.

Returns:

Return tuple of two dictionaries: (fit_res, stats_res) - fit_res: Dictionary containing fitted model parameters. - stats_res: Dictionary containing goodness-of-fit statistics and growth metrics

Return type:

tuple[dict, dict]