folie.KramersMoyalEstimator

class folie.KramersMoyalEstimator(model, **kwargs)[source]

Kramers-Moyal estimator

Parameters:
modelModel, optional, default=None

A model which can be used for initialization. In case an estimator is capable of online learning, i.e., capable of updating models, this can be used to resume the estimation process.

fetch_model() Model | None[source]

Yields the estimated model. Can be None if fit() was not called.

Returns:
modelModel or None

The estimated model or None.

fit(data, estimator=LinearRegression(copy_X=False, fit_intercept=False, n_jobs=1), **kwargs)[source]

Fits data to the estimator’s internal Model and overwrites it. This way, every call to fetch_model() yields an autonomous model instance.

Parameters:
dataarray_like

Data that is used to fit a model.

estimator: sklearn compatible estimator

Defaut to sklearn.linear_model.LinearRegression(copy_X=False, fit_intercept=False) but any compatible estimator can be used. Estimator should have a coef attibutes after fitting

**kwargs

Additional kwargs.

Returns:
selfEstimator

Reference to self.

fit_fetch(data, **kwargs)[source]

Fits the internal model on data and subsequently fetches it in one call.

Parameters:
dataarray_like

Data that is used to fit the model.

**kwargs

Additional arguments to fit().

Returns:
model

The estimated model.

get_params(deep=False)[source]

Get the parameters.

Returns:
paramsmapping of string to any

Parameter names mapped to their values.

preprocess_traj(trj, **kwargs)[source]

Basic preprocessing

set_params(**params)[source]

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:
**paramsdict

Estimator parameters.

Returns:
selfobject

Estimator instance.

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().

Examples using folie.KramersMoyalEstimator

Overdamped Langevin Estimation

Overdamped Langevin Estimation

ABMD biased dynamics

ABMD biased dynamics

1D Biased Double Well

1D Biased Double Well

1D Double Well

1D Double Well

2D Biased Double Well

2D Biased Double Well