calamari.fitting.models.segmented_linear#
- calamari.fitting.models.segmented_linear(x, x_break, y_break, slope_below, slope_change)#
Two straight lines joined at a sharp corner (a continuous “broken stick”).
y = y_break + slope_below * (x - x_break) + slope_change * max(0, x - x_break), so the slope isslope_belowforx < x_breakandslope_below + slope_changeabove it. This is the shape of a kink: a susceptibility whose temperature slope changes at an ordering transition without a peak, or a magnetisation whose field slope changes at a spin-flop.It is parametrised at the break rather than as
a + b x + c max(0, x - x_break). An intercept atx = 0is an extrapolation far outside the data whenever they sit away from the origin, and it is then almost perfectly anticorrelated with the slope (a transition at 150 K: the correlation rounds to -1 at four decimals). Measured at the corner instead, every correlation is set by the data’s shape alone and is the same wherever the origin ofxlies.The corner is sharp by construction. A real transition is rounded, and a sharp-corner fit to a rounded one places
x_breakby an amount that depends on where the fitting range sits; seefit_breakpoint()for what that does to the error bar and the check that exposes it.- Parameters:
- Return type:
- Returns:
numpy.ndarray–yat eachx.