1. A method for classifying portions of an input measurement sequence into a plurality of regimes, comprising: associating each of a plurality of dynamic models with one of a plurality of switching states such that a model is selected when its associated switching state is true; determining a state transition record by determining and recording, for a given measurement of the sequence and for each switching state, an optimal prior switching state, based on the input sequence, wherein the optimal prior switching state optimizes a transition probability; determining, for a final measurement, an optimal final switching state; determining a switching state sequence by backtracking, from said optimal final switching state, through the state transition record; and classifying portions of the input sequence into different regimes, responsive to the switching state sequence.