pyhctsa.robust.bf_fit_density_curve¶
- pyhctsa.robust.bf_fit_density_curve(x, p, model)¶
Deterministic least-squares fit of a simple curve to a density (hctsa
BF_FitDensityCurve).Fits a Gaussian, a sum of two Gaussians, an exponential or a power law to a density (or histogram)
pat the pointsxby minimizing the sum of squared differences. No random starts and no toolbox optimizer: each model starts at a fixed point computed from the data, and a Levenberg-Marquardt iteration with analytic Jacobians descends to the nearest minimum.Models:
'exp'(a*exp(b*t),t = (x - mean(x))/std(x), started from thep^2-weighted line oflog pagainstt),'power'(t = log(x/mean(x)), positivex),'gauss'(the better of two starts: the distribution’s mean and standard deviation; its peak and half the standard deviation) and'gauss2'(started frombf_gauss_mix2(); equally spacedx).