Assume the time series X_t
is given. Is there any already implemented python
function for finding best piecewise constant (not linear in general) approximation for it? Ideally dependent on the number of breaks.
UPD Once again, it differs from How to apply piecewise linear fit in Python?, because I need specifically constant piecewise approximation (curve fit!) with k=0
with given number of breaks.