class OOMReweightedMSM¶
- class deeptime.markov.msm.OOMReweightedMSM(lagtime, reversible=True, count_mode='sliding', sparse=False, time_unit='1 step', nbs=10000, rank_mode='bootstrap_counts', tol_rank=10.0, connectivity_threshold='1/n')¶
OOM (observable operator model) MSM estimator for MSMs given discrete trajectory statistics. Here, each transition is re-weighted using OOM theory. Details can be found in [1].
- Parameters:
lagtime (int) – lag time at which transitions are counted and the transition matrix is estimated.
reversible (bool, optional, default = True) – If true compute reversible MSM, else non-reversible MSM
count_mode (str, optional, default='sliding') –
mode to obtain count matrices from discrete trajectories. Should be one of:
’sliding’ : A trajectory of length T will have \(T-\tau\) counts at time indexes
\[(0 \rightarrow \tau), (1 \rightarrow \tau+1), ..., (T-\tau-1 \rightarrow T-1)\]’sample’ : A trajectory of length T will have \(T/\tau\) counts at time indexes
\[(0 \rightarrow \tau), (\tau \rightarrow 2 \tau), ..., (((T/\tau)-1) \tau \rightarrow T)\]
sparse (bool, optional, default = False) – If true compute count matrix, transition matrix and all derived quantities using sparse matrix algebra. In this case python sparse matrices will be returned by the corresponding functions instead of numpy arrays. This behavior is suggested for very large numbers of states (e.g. > 4000) because it is likely to be much more efficient.
time_unit (str, optional, default='1 step') –
Description of the physical time of the input trajectories. May be used by analysis algorithms such as plotting tools to pretty-print the axes. By default ‘1 step’, i.e. there is no physical time unit. Specify by a number, whitespace and unit. Permitted units are (* is an arbitrary string):
’fs’, ‘femtosecond*’’ps’, ‘picosecond*’’ns’, ‘nanosecond*’’us’, ‘microsecond*’’ms’, ‘millisecond*’’s’, ‘second*’nbs (int, optional, default=10000) – number of re-samplings for rank decision in OOM estimation.
rank_mode (str, optional) –
Re-sampling method for model rank selection. Can be
’bootstrap_counts’: Directly re-sample transitions based on effective count matrix.
’bootstrap_trajs’: Re-draw complete trajectories with replacement.
tol_rank (float, optional, default = 10.0) – signal-to-noise threshold for rank decision.
connectivity_threshold (float or '1/n') – minimum number of counts to consider a connection between two states. Counts lower than that will count zero in the connectivity check and may thus separate the resulting transition matrix. The default evaluates to 1/n_states.
References
Attributes
Property reporting whether this estimator contains an estimated model.
Shortcut to
fetch_model()
.If true compute reversible MarkovStateModel, else non-reversible MarkovStateModel
If true compute count matrix, transition matrix and all derived quantities using sparse matrix algebra.
Methods
Yields the estimated Koopman reweighted MSM.
fit
(dtrajs, **kw)Fits an MSM using Koopman reweighting.
fit_fetch
(data, **kwargs)Fits the internal model on data and subsequently fetches it in one call.
get_params
([deep])Get the parameters.
set_params
(**params)Set the parameters of this estimator.
- fetch_model() KoopmanReweightedMSM ¶
Yields the estimated Koopman reweighted MSM.
- Returns:
model – The estimated Koopman reweighted MSM or None if fit was not called yet.
- Return type:
KoopmanReweightedMSM or None
- fit(dtrajs, **kw)¶
Fits an MSM using Koopman reweighting.
- Parameters:
dtrajs (array_like or list of array_like) – Discrete trajectories.
**kw – API compatibility to sklearn, not actually used in algorithm.
- fit_fetch(data, **kwargs)¶
Fits the internal model on data and subsequently fetches it in one call.
- Parameters:
data (array_like) – Data that is used to fit the model.
**kwargs – Additional arguments to
fit()
.
- Returns:
The estimated model.
- Return type:
model
- get_params(deep=False)¶
Get the parameters.
- Returns:
params – Parameter names mapped to their values.
- Return type:
mapping of string to any
- set_params(**params)¶
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects (such as pipelines). The latter have parameters of the form
<component>__<parameter>
so that it’s possible to update each component of a nested object.- Parameters:
**params (dict) – Estimator parameters.
- Returns:
self – Estimator instance.
- Return type:
object
- property has_model: bool¶
Property reporting whether this estimator contains an estimated model. This assumes that the model is initialized with None otherwise.
- Type:
bool
- property model¶
Shortcut to
fetch_model()
.
- property reversible: bool¶
If true compute reversible MarkovStateModel, else non-reversible MarkovStateModel
- property sparse: bool¶
If true compute count matrix, transition matrix and all derived quantities using sparse matrix algebra. In this case python sparse matrices will be returned by the corresponding functions instead of numpy arrays. This behavior is suggested for very large numbers of states (e.g. > 4000) because it is likely to be much more efficient.