kinextract.run_joint_fit
- kinextract.run_joint_fit(st: FitState, cfg, write_outputs: bool = False, outdir: str = '.', prefix: str | None = None) dict[source]
Run the joint fit and package results in the same shape as
kinextract.fitting.run_spectral_fit()’s"outputs"dict.This is the entry point
kinextract.fitting.run_spectral_fit()dispatches to whenevercfg.fit_continuum=Trueorcfg.joint_prenorm=True. Whether a continuum is actually co-fit is controlled bycfg.fit_continuum: if True, a free P-spline continuum is co-fit; if False (the pre-normalized-mode convention), the continuum is fixed at 1.0 (seefit_joint()’s fit_continuum parameter) – there is nothing genuine for a free continuum to fit once the data’s own continuum has already been divided out, and the sigl0/v_center/xlam-selection improvements apply identically either way. It reuses the correspondingFitConfigfields with equivalent semantics (cfg.siglas the initial sigl0 guess,cfg.xlam_auto_grid/xlam_chi2_tolerance/xlam_max_peaks/xlam_peak_min_prominencefor the xlam search,cfg.use_jax_objective,cfg.map_maxiter/map_ftol/map_maxfun) plus thejoint_*-prefixed fields for concepts that have no shipped-pipeline analogue (P-spline knot count/degree/roughness weight, the sigl0 fixed-point iteration count/tolerance, whether to recenterv_center).- Parameters:
st (FitState) – Fit state to optimize (mutated:
continuum_multis set to the recovered P-spline continuum so downstream plotting/ascii output reflects it).cfg (FitConfig) – Run configuration.
write_outputs (bool, optional) – If True, write legacy-format output files via
kinextract.io.write_fitlov_outputs_from_model().outdir (optional) – Passed through when write_outputs is True.
prefix (optional) – Passed through when write_outputs is True.
- Returns:
Same keys as the shipped pipeline’s
outputsdict ("gp","b","w","wfrac","tt","coff","coff2","A","rms","chi2_red","chi2_total","nrms","continuum","paths"), with"coff"=0.0,"coff2"=0.0,"A"=1.0as neutral placeholders (the joint model has no analogous parameters – its continuum is the P-spline baked directly into"gp"/"continuum"), plus"result","design","best_xlam", and"sigl0_trace"for the joint fit’s own diagnostics.- Return type: