Graph Laplacian/diffusion maps-based LCS methods
The LCS approaches implemented and described in this section are strongly influenced by ideas developed in the spectral clustering/diffusion maps communities. The general references include:
- Shi & Malik, Normalized cuts and image segmentation, 2000
- Coifman & Lafon, Diffusion maps, 2006
- Marshall & Hirn, Time coupled diffusion maps, 2018
In the LCS context, these ideas have been adopted in the following works:
- somewhat related Froyland & Padberg-Gehle, 2015
- Hadjighasem et al., 2016
- Banisch & Koltai, 2017
- Rypina et al., 2017/Padberg-Gehle & Schneide, 2018
For demonstrations on example cases, please consult the page on Working with trajectories.
Function documentation
Sparsification methods
Three commonly used sparsification methods are implemented for use with various graph Laplacian methods.
CoherentStructures.KNN
— TypeKNN(k) <: SparsificationMethod
Defines the KNN (k-nearest neighbors) sparsification method. In this approach, first k
nearest neighbors are sought. In the final graph Laplacian, only those particle pairs are included which are contained in some k-Neighborhood.
CoherentStructures.MutualKNN
— TypeMutualKNN(k) <: SparsificationMethod
Defines the mutual KNN (k-nearest neighbors) sparsification method. In this approach, first k
nearest neighbors are sought. In the final graph Laplacian, only those particle pairs are included which are mutually contained in each others k-Neighborhood.
CoherentStructures.Neighborhood
— TypeNeighborhood(ε) <: SparsificationMethod
Defines the ε-Neighborhood sparsification method. In the final graph Laplacian, only those particle pairs are included which have distance less than ε
.
Other sparsification methods can be implemented by defining a SparsificationMethod
type and a corresponding spdist
method.
Diffusion-maps-type/adjancency-matrix-based graph Laplacian methods
Since the Euclidean heat kernel is ubiquitous in diffusion maps-based computations, we provide it for convenience.
CoherentStructures.gaussian
— Functiongaussian(σ=1.0)
Returns the Euclidean heat kernel as a callable function
\[x \mapsto \exp\left(-\frac{x^2}{4\sigma}\right)\]
Example
julia> kernel = gaussian(2.0);
julia> kernel(0.)
1.0
CoherentStructures.gaussiancutoff
— Functiongaussiancutoff(σ, θ = eps())
Computes the positive value at which gaussian(σ)
equals θ
, i.e.,
\[\sqrt{-4\sigma\log(\theta)}\]
To compute a sparse distance matrix (or adjacency matrix, depending on the sparsification method), use spdist
.
CoherentStructures.spdist
— Functionspdist(data, sp_method, metric=Euclidean()) -> SparseMatrixCSC
Return a sparse distance matrix as determined by the sparsification method sp_method
and metric
.
The main high-level functions for the above-listed methods are the following.
CoherentStructures.sparse_diff_op_family
— Functionsparse_diff_op_family(data, sp_method, kernel, op_reduce; α, metric, verbose)
Return a list of sparse diffusion/Markov matrices P
.
Arguments
data
: a list of trajectories, each a list of states of typeSVector
;sp_method
: a sparsification method;kernel=gaussian()
: diffusion kernel, e.g.,gaussian
;op_reduce=P -> prod(LinearMaps.LinearMap, reverse(P))
: time-reduction of diffusion operators, e.g.Statistics.mean
(space-time diffusion maps),P -> row_normalize!(min.(sum(P), 1))
(network-based coherence) or the defaultP -> prod(LinearMaps.LinearMap, reverse(P))
(time coupled diffusion maps)
Keyword arguments
α=1
: exponent in diffusion-map normalization;metric=Euclidean()
: distance function w.r.t. which the kernel is computed, however, only for point pairs where $metric(x_i, x_j)\leq \varepsilon$;verbose=false
: whether to print intermediate progress reports.
CoherentStructures.sparse_diff_op
— Functionsparse_diff_op(data, sp_method, kernel; α=1, metric=Euclidean()) -> SparseMatrixCSC
Return a sparse diffusion/Markov matrix P
.
Arguments
data
: a list of trajectories, each a list of states of typeSVector
, or a list of states of typeSVector
;sp_method
: a sparsification method;kernel
: diffusion kernel, e.g.,gaussian
;
Keyword arguments
α
: exponent in diffusion-map normalization;metric
: distance function w.r.t. which the kernel is computed, however, only for point pairs where $metric(x_i, x_j)\leq \varepsilon$.
Normalization functions
In the diffusion maps framework, there are two commonly used normalization steps:
- kernel-density estimate normalization (
kde_normalize!
), and - row normalization (
row_normalize!
), to obtain a diffusion/Markov operator (w.r.t. right- and left-action, respectively).
CoherentStructures.kde_normalize!
— Functionkde_normalize!(A, α=1)
Normalize rows and columns of A
in-place with the respective row-sum to the α-th power; i.e., return $a_{ij}:=a_{ij}/q_i^{\alpha}/q_j^{\alpha}$, where $q_k = \sum_{\ell} a_{k\ell}$. Default for α
is 1
.
CoherentStructures.row_normalize!
— Functionrow_normalize!(A)
Normalize rows of A
in-place with the respective row-sum; i.e., return $a_{ij}:=a_{ij}/q_i$.
Diffusion-coordinate-like functions
CoherentStructures.diffusion_coordinates
— Functiondiffusion_coordinates(P, n_coords) -> (Σ, Ψ)
Compute the (time-coupled) diffusion coordinate matrix Ψ
and the coordinate weight vector Σ
for a diffusion operator P
. The argument n_coords
determines the number of diffusion coordinates to be computed.
CoherentStructures.diffusion_distance
— Functiondiffusion_distance(Ψ)
Returns the symmetric pairwise diffusion distance matrix corresponding to points whose diffusion coordinates are given by Ψ
.