fuzzyclust.timeseries#

Clustering of time series.

Time-ordered data ask for clusters with a structure that plain fuzzy clustering does not know: segments must be contiguous in time, regressors of a dynamic model must be chosen before the model is fitted, and the state of a chaotic system has to be reconstructed from a scalar measurement. This sub-package collects the clustering-based answers of the Abonyi group:

Fuzzy segmentation, model order selection, state-space reconstruction and prediction, structure selection with mixed inputs.

Classes#

FuzzySegmentation([n_segments, m, ...])

Fuzzy segmentation of a multivariate time series (modified Gath–Geva clustering).

ChaoticPredictor([dim, delay, n_clusters, ...])

Operating-regime model of a chaotic series in the reconstructed state space.

MixedInputStructureSelection([n_clusters, ...])

Estimator form of select_structure_mixed().

Functions#

bottom_up_segmentation(X[, n_components, ...])

Bottom-up segmentation with PCA models (Keogh et al. style, multivariate extension).

pca_segment_cost(X, n_components[, cost, center])

Cost of approximating a segment by one PCA model with n_components components.

false_nearest_neighbors(y[, u, max_na, ...])

Classical false-nearest-neighbor percentages over the model orders \((n_a, n_b)\).

fnn_model_order(y[, u, max_na, max_nb, ...])

Model order of a NARX model by false nearest neighbors with a cluster-based threshold.

select_model_order(y[, u, max_na, max_nb])

Convenience wrapper of fnn_model_order() returning only the selected orders.

cluster_based_threshold(Phi, target[, ...])

Point-wise FNN thresholds \(R_k\) from Gath–Geva clusters in the regression space.

delay_embedding(y, dim[, delay])

Delay vectors \(\mathbf{y}_k=[y_k, y_{k-\tau},\dots,y_{k-\tau(d_e-1)}]^T\) of a scalar series.

select_delay(y[, max_lag, method, n_bins])

Lag \(\tau\) of the delay embedding from the series itself.

embedding_scan(y[, dims, delay, n_clusters, ...])

Fit ChaoticPredictor for several embedding dimensions and tabulate the criteria.

select_embedding_dimension(table[, ratio_tol])

Read the embedding and the local dimension off an embedding_scan() table.

correlation_dimension(Y[, radii, n_radii, ...])

Grassberger–Procaccia correlation dimension of a point cloud (e.g. delay vectors).

select_structure_mixed(X, y[, discrete, ...])

Rank all candidate input structures by their fuzzy variance (Girimonte, Babuška & Abonyi).

fuzzy_variance(memberships, y)

Total fuzzy variance \(\sigma_t\) of y over the fuzzy segments spanned by several inputs.

plot_segmentation(model, X[, t, features, ...])

Time plots of the variables with the fuzzy segments underneath.

plot_fnn_table(table[, ax, selected, ...])

Heat map of the percentage of false nearest neighbors over the orders \((n_a, n_b)\).

plot_embedding_scan(table[, axes, selected])

One-step prediction error and local-dimension index versus the embedding dimension.

plot_phase_space(Y[, labels, dims, centers, ...])

Two coordinates of a reconstructed (or true) state space, colored by cluster.

plot_structure_ranking(ranking[, n_show, ...])

Variance--complexity trade-off \(VCT=\sigma_t n_i\) along the ranking of structures.

make_piecewise_timeseries([n_samples, ...])

Multivariate series with planted regime changes (segmentation benchmark).

make_mackey_glass([n_samples, tau, a, b, n, ...])

Mackey–Glass delay-differential series (chaotic for \(\tau=17\)).

make_lorenz([n_samples, dt, sigma, rho, ...])

Trajectory of the Lorenz system (RK4, fixed step).

make_rossler([n_samples, dt, a, b, c, x0, ...])

Trajectory of the Rössler system with the parameters of Abonyi et al. (2004).

make_nonlinear_io_system([n_samples, dt, ...])

Continuous polymerization reactor benchmark of the FNN model-order paper.

make_mixed_input_system([n_samples, noise, ...])

Regression problem with one discrete and several continuous inputs.