API¶
analysis¶
- class cmdtools.analysis.pcca.PCCA(T=None, n=None, pi='uniform', massmatrix=None, eigensolver=<cmdtools.analysis.schur.ScipySchur object>, optimizer=<cmdtools.analysis.optimization.Optimizer object>)[source]¶
- cmdtools.analysis.pcca.gramschmidt(X, pi)[source]¶
Gram Schmidt orthogonalization wrt. scalar product induced by pi
- cmdtools.analysis.optimization.fillA(A, X)[source]¶
Converts the given matrix into a feasible transformation matrix. Algorithm 3.10 from Weber (2006)
- cmdtools.analysis.optimization.indexsearch(X)[source]¶
Return the indices to the rows spanning the largest simplex
- cmdtools.analysis.optimization.inner_simplex_algorithm(X)[source]¶
Return the transformation A mapping those rows of X which span the largest simplex onto the unit simplex.
estimation¶
- class cmdtools.estimation.galerkin.Gaussian(timeseries, centers=None, sqd=None, sigma=None, percentile=50)[source]¶
- property propagator¶
- class cmdtools.estimation.galerkin.TransferOperatorGalerkin(basis)[source]¶
Class resposible for computing the Monte-Carlo estimates of the Perron-Frobenius and Koopman operators wrt to a given Basis
- cmdtools.estimation.galerkin.find_bandwidth(sqd, percentile=50)[source]¶
Given the square-distance matrix d_ij = (x_i - x_j)^2 compute the standard deviation s for the Gaussian kernel k(x_i,x_j) = exp(-1/(2s^2) d_ij). The heuristic is based on the assumption that we want sum_j k(x_i, x_j) ≈ n exp(-1/(2s^2) med^2) = 1 and hence (2s^2) = med^2 / log n where n is the number of points and med the pairwise median distance.
percentile allows to shift from the median to an arbitrary percentage and thus influences how many points have an influence on the bandwith.
Heuristic taken from “Stein Variational Gradient Descent […], Qiang Liu and Dilin Wang (2016)”.
- Input:
sqd: matrix, pairwise squared-distances of the samples percentile: float [0,100], percentile to use instead of median
- Output:
sigma: float, the standard deviation of the Gaussian
- cmdtools.estimation.galerkin.massmatrix(membership)[source]¶
Compute the row-stochastic empirical mass function S_ij = St_ij / sum_j St_ij St_ij = 1/n sum_x phi_i(x) phi_j(x), x in traj cf. ([TGDW2019] eqn 12, [W2006] eqn 35)
- Parameters
membership (matrix) – row-stochastic membership matrix of shape (#samples x #basis)
- Returns
row-stochastic mass matrix S
- Return type
matrix
- cmdtools.estimation.galerkin.membership(sqd, sigma)[source]¶
Given square distances and standard deviation, return the row-stochastic Gaussian membership matrix
- cmdtools.estimation.galerkin.propagator(membership, lag=1)[source]¶
Compute the row-stochastic empirical propagator K_ij = Kt_ij / sum_j Kt_ij Kt_ij = 1/n sum_x phi_i(x) phi_j(y), (x,y) in traj cf. ([TGDW2019] eqn 12, [W2006] eqn 35)
- Parameters
membership (matrix) – row-stochastic membership matrix of shape (#samples x #basis)
- Returns
row-stochastic propagator P
- Return type
matrix
- class cmdtools.estimation.sqra.SQRA(u, beta=1, phi=1, A=None, torus=False)[source]¶
approximate the generator/rate-matrix Q of the Overdamped-Langevin dynamics :param u: The potential function evaluated at the grid points. :type u: ndarray :param beta: The inverse temperatur of the system (scales the rates nonlinear). :type beta: float :param phi: Linear scaling factor of the rates (depending on the grid volume). :type phi: float :param A: Adjacency matrix of the grid. If left empty, automatically compute it based on the shape of u. :type A: matrix, optional :param torus: Whether to glue the corresponding dimensions together at their resp. boundaries. Only used in the automatic generation of A. :type torus: list of bool
- A¶
Adjacency matrix
- Q¶
The computed generator
- cmdtools.estimation.sqra.sqra(u, A, beta, phi)[source]¶
Square-root approximation of the generator (of the Overdamped Langevin model)
u: vector of pointwise evaluation of the potential A: adjacency matrix of the discretization beta: inverse temperature phi: the flux constant, determined by the temperature and the discr.
systems¶
utils¶
- cmdtools.utils.euclidean_torus(periods)[source]¶
euclidean metric on a d-dimensional torus with given periods. using np.inf for a specific period corresponds to the usual euclidean distance in that dimension
- cmdtools.utils.example_metastab4()[source]¶
Return the transition matrix for a simple metastable model. The 4 correpsonding states are [A,T,B,B], where A and B are metastable and T is a transition region