pyemma.msm.OOMReweightedMSM

class pyemma.msm.OOMReweightedMSM(*args, **kwargs)

OOM based estimator for MSMs given discrete trajectory statistics

__init__(lag=1, reversible=True, count_mode='sliding', sparse=False, connectivity='largest', dt_traj='1 step', nbs=10000, rank_Ct='bootstrap_counts', tol_rank=10.0, score_method='VAMP2', score_k=10, mincount_connectivity='1/n')

Maximum likelihood estimator for MSMs given discrete trajectory statistics

Parameters
  • lag (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.

  • connectivity (str, optional, default = 'largest') –

    Connectivity mode. Three methods are intended (currently only ‘largest’ is implemented)

    • ’largest’ : The active set is the largest reversibly connected set. All estimation will be done on this subset and all quantities (transition matrix, stationary distribution, etc) are only defined on this subset and are correspondingly smaller than the full set of states

    • ’all’ : The active set is the full set of states. Estimation will be conducted on each reversibly connected set separately. That means the transition matrix will decompose into disconnected submatrices, the stationary vector is only defined within subsets, etc. Currently not implemented.

    • ’none’ : The active set is the full set of states. Estimation will be conducted on the full set of states without ensuring connectivity. This only permits nonreversible estimation. Currently not implemented.

  • dt_traj (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_Ct (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.

  • score_method (str, optional, default='VAMP2') –

    Score to be used with score function. Available are:

    ’VAMP1’ 1
    ’VAMP2’ 1
    ’VAMPE’ 1

  • score_k (int or None) – The maximum number of eigenvalues or singular values used in the score. If set to None, all available eigenvalues will be used.

  • mincount_connectivity (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/nstates.

References

1(1,2,3,4,5,6,7)

H. Wu and F. Noe: Variational approach for learning Markov processes from time series data (in preparation)

Methods

_Loggable__create_logger()

_SerializableMixIn__interpolate(state, klass)

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(other)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getstate__()

__gt__(value, /)

Return self>value.

__init__([lag, reversible, count_mode, …])

Maximum likelihood estimator for MSMs given discrete trajectory statistics

__init_subclass__(*args, **kwargs)

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__my_getstate__()

__my_setstate__(state)

__ne__(value, /)

Return self!=value.

__new__(cls, *args, **kwargs)

Create and return a new object.

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__setstate__(state)

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_assert_in_active(A)

Checks if set A is within the active set

_assert_metastable()

Tests if pcca object is available, or else raises a ValueError.

_blocksplit_dtrajs(dtrajs, sliding)

Override splitting method of base class.

_check_estimated()

_check_is_estimated()

_cleanup_logger(logger_id, logger_name)

_committor_backward(P, A, B[, mu])

_committor_forward(P, A, B)

_compute_eigendecomposition(neig)

Conducts the eigenvalue decomposition and stores k eigenvalues, left and right eigenvectors

_compute_eigenvalues(neig)

Conducts the eigenvalue decomposition and stores k eigenvalues, left and right eigenvectors

_ensure_eigendecomposition([neig])

Ensures that eigendecomposition has been performed with at least neig eigenpairs

_ensure_eigenvalues([neig])

Ensures that at least neig eigenvalues have been computed

_estimate(dtrajs)

Estimate MSM

_get_classes_to_inspect()

gets classes self derives from which 1.

_get_dtraj_stats(dtrajs)

Compute raw trajectory counts

_get_interpolation_map(cls)

_get_model_param_names()

Get parameter names for the model

_get_param_names()

Get parameter names for the estimator

_get_private_field(cls, name[, default])

_get_serialize_fields(cls)

_get_state_of_serializeable_fields(klass, state)

:return a dictionary {k:v} for k in self.serialize_fields and v=getattr(self, k)

_get_version(cls[, require])

_get_version_for_class_from_state(state, klass)

retrieves the version of the current klass from the state mapping from old locations to new ones.

_logger_is_active(level)

@param level: int log level (debug=10, info=20, warn=30, error=40, critical=50)

_mfpt(P, A, B[, mu])

_set_state_from_serializeable_fields_and_state(…)

set only fields from state, which are present in klass.__serialize_fields

cktest(nsets[, memberships, mlags, conf, …])

Conducts a Chapman-Kolmogorow test.

coarse_grain(ncoarse[, method])

Returns a coarse-grained Markov model.

committor_backward(A, B)

Backward committor from set A to set B

committor_forward(A, B)

Forward committor (also known as p_fold or splitting probability) from set A to set B

correlation(a[, b, maxtime, k, ncv])

Time-correlation for equilibrium experiment.

eigenvalues([k])

Compute the transition matrix eigenvalues

eigenvectors_left([k])

Compute the left transition matrix eigenvectors

eigenvectors_right([k])

Compute the right transition matrix eigenvectors

estimate(dtrajs, **kwargs)

param dtrajs

discrete trajectories, stored as integer ndarrays (arbitrary size)

expectation(a)

Equilibrium expectation value of a given observable.

fingerprint_correlation(a[, b, k, ncv])

Dynamical fingerprint for equilibrium time-correlation experiment.

fingerprint_relaxation(p0, a[, k, ncv])

Dynamical fingerprint for perturbation/relaxation experiment.

fit(X[, y])

Estimates parameters - for compatibility with sklearn.

generate_traj(N[, start, stop, stride])

Generates a synthetic discrete trajectory of length N and simulation time stride * lag time * N

get_model_params([deep])

Get parameters for this model.

get_params([deep])

Get parameters for this estimator.

hmm(nhidden)

Estimates a hidden Markov state model as described in 1

load(file_name[, model_name])

Loads a previously saved PyEMMA object from disk.

mfpt(A, B)

Mean first passage times from set A to set B, in units of the input trajectory time step

pcca(m)

Runs PCCA++ 1 to compute a metastable decomposition of MSM states

propagate(p0, k)

Propagates the initial distribution p0 k times

relaxation(p0, a[, maxtime, k, ncv])

Simulates a perturbation-relaxation experiment.

sample_by_distributions(distributions, nsample)

Generates samples according to given probability distributions

sample_by_state(nsample[, subset, replace])

Generates samples of the connected states.

save(file_name[, model_name, overwrite, …])

saves the current state of this object to given file and name.

score(dtrajs[, score_method, score_k])

Scores the MSM using the dtrajs using the variational approach for Markov processes 1 [2]_

score_cv(dtrajs[, n, score_method, score_k])

Scores the MSM using the variational approach for Markov processes 1 [2]_ and crossvalidation [3]_ .

set_model_params(P[, pi, reversible, …])

Call to set all basic model parameters.

set_params(**params)

Set the parameters of this estimator.

simulate(N[, start, stop, dt])

Generates a realization of the Markov Model

timescales([k])

The relaxation timescales corresponding to the eigenvalues

trajectory_weights()

Uses the MSM to assign a probability weight to each trajectory frame.

update_model_params(**params)

Update given model parameter if they are set to specific values

Attributes

OOM_components

Return OOM components.

OOM_omega

Return OOM initial state vector.

OOM_rank

Return OOM model rank.

OOM_sigma

Return OOM evaluator vector.

P

The transition matrix on the active set.

_Estimator__serialize_fields

_Loggable__ids

_Loggable__refs

_MSMEstimator__serialize_fields

_MSMEstimator__serialize_version

_MSM__serialize_fields

_MSM__serialize_version

_OOMReweightedMSM__serialize_fields

_OOMReweightedMSM__serialize_version

_SerializableMixIn__serialize_fields

_SerializableMixIn__serialize_modifications_map

_SerializableMixIn__serialize_version

__dict__

__doc__

__hash__

__module__

__weakref__

list of weak references to the object (if defined)

_estimated

_loglevel_CRITICAL

_loglevel_DEBUG

_loglevel_ERROR

_loglevel_INFO

_loglevel_WARN

_save_data_producer

active_count_fraction

The fraction of counts in the largest connected set.

active_set

The active set of states on which all computations and estimations will be done

active_state_fraction

The fraction of states in the largest connected set.

active_state_indexes

Ensures that the connected states are indexed and returns the indices

connected_sets

The reversible connected sets of states, sorted by size (descending)

connectivity

Returns the connectivity mode of the MSM

core_set

list of states which are defined to lie within the core set.

count_matrix_active

The count matrix on the active set given the connectivity mode used.

count_matrix_full

The count matrix on full set of discrete states, irrespective as to whether they are connected or not.

discrete_trajectories_active

A list of integer arrays with the discrete trajectories mapped to the connectivity mode used.

discrete_trajectories_full

A list of integer arrays with the original (unmapped) discrete trajectories:

discrete_trajectories_unmodified

A list of integer arrays with the original and not modified discrete trajectories.

dt_model

Description of the physical time corresponding to the lag.

dt_traj

dtrajs_active

A list of integer arrays with the discrete trajectories mapped to the connectivity mode used.

dtrajs_full

A list of integer arrays with the original (unmapped) discrete trajectories:

dtrajs_milestone_counting_offsets

Offsets for milestone counted trajectories for each input discrete trajectory.

dtrajs_unmodified

A list of integer arrays with the original and not modified discrete trajectories.

eigenvalues_OOM

System eigenvalues estimated by OOM.

is_reversible

Returns whether the MSM is reversible

is_sparse

Returns whether the MSM is sparse

lag

The lag time at which the Markov model was estimated

lagtime

The lag time at which the Markov model was estimated

largest_connected_set

The largest reversible connected set of states

logger

The logger for this class instance

metastable_assignments

Assignment of states to metastable sets using PCCA++

metastable_distributions

Probability of metastable states to visit an MSM state by PCCA++

metastable_memberships

Probabilities of MSM states to belong to a metastable state by PCCA++

metastable_sets

Metastable sets using PCCA++

model

The model estimated by this Estimator

n_metastable

Number of states chosen for PCCA++ computation.

name

The name of this instance

neig

number of eigenvalues to compute.

nstates

Number of active states on which all computations and estimations are done

nstates_full

Number of states in discrete trajectories

pi

The stationary distribution on the MSM states

reversible

Returns whether the MSM is reversible

sparse

Returns whether the MSM is sparse

stationary_distribution

The stationary distribution on the MSM states

timescales_OOM

System timescales estimated by OOM.

timestep_model

Physical time corresponding to one transition matrix step, e.g.

transition_matrix

The transition matrix on the active set.