pyemma.coordinates.estimation.covariance.LaggedCovariance

class pyemma.coordinates.estimation.covariance.LaggedCovariance(c00=True, c0t=False, ctt=False, remove_constant_mean=None, remove_data_mean=False, reversible=False, bessel=True, sparse_mode='auto', modify_data=False, lag=0, weights=None, stride=1, skip=0, chunksize=NotImplemented, ncov_max=inf)
__init__(c00=True, c0t=False, ctt=False, remove_constant_mean=None, remove_data_mean=False, reversible=False, bessel=True, sparse_mode='auto', modify_data=False, lag=0, weights=None, stride=1, skip=0, chunksize=NotImplemented, ncov_max=inf)

Methods

__init__([c00, c0t, ctt, …])
estimate(X[, chunksize])
fit(X[, y]) Estimates parameters - for compatibility with sklearn.
get_params([deep]) Get parameters for this estimator.
load(file_name[, model_name]) loads a previously saved object of this class from a file.
partial_fit(X) incrementally update the estimates
save(file_name[, model_name, overwrite, …]) saves the current state of this object to given file and name.
set_params(**params) Set the parameters of this estimator.
C00_

Instantaneous covariance matrix

C0t_

Time-lagged covariance matrix

Ctt_

Covariance matrix of the time shifted data

fit(X, y=None)

Estimates parameters - for compatibility with sklearn.

Parameters:X (object) – A reference to the data from which the model will be estimated
Returns:estimator – The estimator (self) with estimated model.
Return type:object
get_params(deep=True)

Get parameters for this estimator.

Parameters:deep (boolean, optional) – If True, will return the parameters for this estimator and contained subobjects that are estimators.
Returns:params – Parameter names mapped to their values.
Return type:mapping of string to any
load(file_name, model_name='default')

loads a previously saved object of this class from a file.

Parameters:
  • file_name (str or file like object (has to provide read method)) – The file like object tried to be read for a serialized object.
  • model_name (str, default='default') – if multiple models are contained in the file, these can be accessed by their name. Use func:pyemma.list_models to get a representation of all stored models.
Returns:

obj

Return type:

the de-serialized object

logger

The logger for this class instance

model

The model estimated by this Estimator

name

The name of this instance

partial_fit(X)

incrementally update the estimates

Parameters:X (array, list of arrays, PyEMMA reader) – input data.
save(file_name, model_name='default', overwrite=False, save_streaming_chain=False)

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

Parameters:
  • file_name (str) – path to desired output file
  • model_name (str, default='default') – creates a group named ‘model_name’ in the given file, which will contain all of the data. If the name already exists, and overwrite is False (default) will raise a RuntimeError.
  • overwrite (bool, default=False) – Should overwrite existing model names?
  • save_streaming_chain (boolean, default=False) – if True, the data_producer(s) of this object will also be saved in the given file.

Examples

>>> import pyemma, numpy as np
>>> from pyemma.util.contexts import named_temporary_file
>>> m = pyemma.msm.MSM(P=np.array([[0.1, 0.9], [0.9, 0.1]]))
>>> with named_temporary_file() as file: 
...    m.save(file, 'simple') 
...    inst_restored = pyemma.load(file, 'simple') 
>>> np.testing.assert_equal(m.P, inst_restored.P) 
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 former have parameters of the form <component>__<parameter> so that it’s possible to update each component of a nested object. :returns: :rtype: self