HiddenMarkovModel¶
lumicks.pylake.HiddenMarkovModel
- class HiddenMarkovModel(data, n_states, *, tol=0.001, max_iter=250, initial_guess=None)¶
A Hidden Markov Model describing hidden state occupancy and state transitions of observed time series data (force, fluorescence, etc.)
A detailed description of the model properties and training algorithms can be found in [1].
Warning
This is early access alpha functionality. While usable, this has not yet been tested in a large number of different scenarios. The API can still be subject to change without any prior deprecation notice! If you use this functionality keep a close eye on the changelog for any changes that may affect your analysis.
- Parameters:
data (numpy.ndarray | Slice) – Data array used for model training.
n_states (int) – The number of hidden states in the model.
tol (float) – The tolerance for training convergence.
max_iter (int) – The maximum number of iterations to perform.
initial_guess (HiddenMarkovModel | GaussianMixtureModel | None) – Initial guess for the observation model parameters.
References
- emission_path(trace)¶
Calculate the emission path for a given data trace.
- extract_dwell_times(trace, *, exclude_ambiguous_dwells=True)¶
Calculate lists of dwelltimes for each state in a time-ordered state path array.
- Parameters:
- Returns:
Dictionary of all dwell times (in seconds) for each state. Keys are state labels.
- Return type:
- hist(trace, n_bins=100, plot_kwargs=None, hist_kwargs=None)¶
Plot a histogram of the trace data overlaid with the model state path.
- plot(trace, *, trace_kwargs=None, label_kwargs=None)¶
Plot a histogram of the trace data with data points classified in states.
- plot_path(trace, *, trace_kwargs=None, path_kwargs=None)¶
Plot a histogram of the trace data overlaid with the model path.
- state_path(trace)¶
Calculate the state path for a given data trace.
- property fit_info: PopulationFitInfo¶
Information about the model training exit conditions.