class AugmentedMSMEstimator¶
- class deeptime.markov.msm.AugmentedMSMEstimator(expectations_by_state, experimental_measurements, experimental_measurement_weights, eps=0.05, support_ci=1.0, maxiter=500, max_cache=3000)¶
Estimator for augmented Markov state models. [1] This estimator is based on expectation values from experiments. In case the experimental data is a time series matching a discrete time series, a convenience function
estimator_from_feature_trajectories()
is offered.- Parameters:
expectations_by_state ((n, k) ndarray) – Expectations by state. n Markov states, k experimental observables; each index is average over members of the Markov state.
experimental_measurements ((k,) ndarray) – The experimental measurements.
experimental_measurement_weights ((k,) ndarray) – Experimental measurements weights.
eps (float, optional, default=0.05) –
Additional convergence criterion used when some experimental data are outside the support of the simulation. The value of the eps parameter is the threshold of the relative change in the predicted observables as a function of fixed-point iteration:
\[\mathrm{eps} > \frac{\mid o_{\mathrm{pred}}^{(i+1)}-o_{\mathrm{pred}}^{(i)}\mid }{\sigma}. \]support_ci (float, optional, default=1.0) – Confidence interval for determination whether experimental data are inside or outside Markov model support.
maxiter (int, optional, default=500) – Optional parameter with specifies the maximum number of updates for Lagrange multiplier estimation.
max_cache (int, optional, default=3000) – Maximum size (in megabytes) of cache when computing R tensor.
References
Attributes
Additional convergence criterion used when some experimental data are outside the support of the simulation.
The expectations by state (N) for each observable (K).
Weights for experimental measurement averages (K).
Experimental measurement averages (K).
Property reporting whether this estimator contains an estimated model.
Cache size during computation.
Maximum number of Newton iterations.
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.
Confidence interval size for markov states.
Uncertainties based on measurement weights.
Methods
estimator_from_feature_trajectories
(...[, ...])Creates an AMM estimator from discrete trajectories and corresponding experimental data.
Yields the most recently estimated AMM or None if
fit()
was not called yet.fit
(data, *args, **kw)Fits an AMM.
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.
- static estimator_from_feature_trajectories(discrete_trajectories, feature_trajectories, n_states, experimental_measurements, sigmas, eps=0.05, support_ci=1.0, maxiter=500, max_cache=3000)¶
Creates an AMM estimator from discrete trajectories and corresponding experimental data.
- Parameters:
discrete_trajectories (array_like or list of array_like) – Discrete trajectories, stored as integer ndarrays (arbitrary size) or a single ndarray for only one trajectory.
feature_trajectories (array_like or list of array_like) – The same shape (number of trajectories and timesteps) as dtrajs. Each timestep in each trajectory should match the shape of the measurements and sigmas, K.
n_states (int) – Number of markov states in full state space.
experimental_measurements ((K,) ndarray) – Experimental averages.
sigmas ((K,) ndarray) – Standard error for each experimental observable.
eps (float, default = 0.05) – Convergence criterium, see
__init__()
.support_ci (float, default=1.0) – Confidence interval, see
__init__()
.maxiter (int, optional, default=500) – Maximum number of iterations.
max_cache (int, optional, default=3000) – Parameter which specifies the maximum size of cache used when performing estimation of AMM, in megabytes.
- Returns:
estimator – An estimator parameterized expectations by state based on feature trajectories.
- Return type:
- fetch_model() Optional[AugmentedMSM] ¶
Yields the most recently estimated AMM or None if
fit()
was not called yet.- Returns:
amm – The AMM instance.
- Return type:
AugmentedMSM or None
- fit(data, *args, **kw)¶
Fits an AMM.
- Parameters:
data (TransitionCountModel or (N, N) ndarray) – Count matrix over data.
*args – scikit-learn compatibility argument
**kw – scikit-learn compatibility argument
- Returns:
self – Reference to self.
- Return type:
- 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 convergence_criterion_lagrange¶
Additional convergence criterion used when some experimental data are outside the support of the simulation. The value of the eps parameter is the threshold of the relative change in the predicted observables as a function of fixed-point iteration:
$$ mathrm{eps} > frac{mid o_{mathrm{pred}}^{(i+1)}-o_{mathrm{pred}}^{(i)}mid }{sigma}. $$
- property expectations_by_state¶
The expectations by state (N) for each observable (K).
- Type:
(N, K) ndarray
- property experimental_measurement_weights¶
Weights for experimental measurement averages (K).
- Type:
(K,) ndarray
- property experimental_measurements¶
Experimental measurement averages (K).
- Type:
(K,) ndarray
- 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 max_cache¶
Cache size during computation.
- property maxiter¶
Maximum number of Newton iterations.
- 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.
- property support_confidence¶
Confidence interval size for markov states.
- property uncertainties¶
Uncertainties based on measurement weights.