A KISS style implementation of PCCA+ (Robust Perron Cluster Analysis) [1,2] with support for non-reversible systems [3]. For a similar python implementation see also the cmdtools package.
using PCCAPlus
P=rand(10,10)
P = P ./ sum(P, dims=2) # row stochastic matrix
# basic PCCA+ clustering with 2 clusters (using no weighting and the ISA initial guess only)
chi = pcca(P, 2)
using KrylovKit
using SparseArrays
P = sprand(100,100, 0.1)
P = P ./ sum(P, dims=2) # sparse row stochastic matrix
# solve the PCCA+ problem weighted with the stationary density
# and optimize for crispness, using the KrylovKit.jl eigensolver
chi = pcca(P, 2; pi=:stationary, optimize=true, solver=KrylovSolver())
For sparse matrix support, add either the ArnoldiMethod.jl
or KrylovKit.jl
and pass the corresponding ArnoldiSolver()
or KrylovSolver()
as a solver.