cogpy.decomposition.pca

ERP-PCA decomposition of neural signals.

Provides varimax-rotated PCA for spatio-spectral decomposition of ECoG data. The erpPCA class follows the scikit-learn estimator API (fit / transform).

Functions

compute_similarity_matrix(ss1, ss2[, ...])

Pairwise similarity matrix between factors of two SpatSpec instances.

erpPCA2factors(erp, mtx_sws)

Convert fitted erpPCA + spectrogram into (ldx, scx) DataArrays.

erpPCA_ldx(LR, ld_coords, ld_shape)

Reshape rotated loadings into an xr.DataArray (factor, h, w, freq).

erpPCA_scx(FSr, times)

Wrap factor scores into an xr.DataArray (time, factor).

erppca(X[, nFac, maxIt, Tol, IfVerbose, ...])

Run ERP-PCA: covariance → eigen → varimax → sort.

get_invproj(ldx)

Compute inverse projection from loading DataArray (factors, h, w, freq).

get_similarity(ss_series, freq_threshold)

Build an (nrec, nrec) array of (nfac, nfac) similarity matrices.

kaiser_normalization(X)

project_to_loadings(X, inv_proj)

Project data onto pre-computed inverse projection.

pseudo_inverse(LR, cov)

pseudo_inverse_scaled(LR, cov)

redirect_loadings(L)

similarity_metric(ss1, ss2, fac1, fac2[, ...])

Correlation-based similarity between two SpatSpec factors.

simplicity_criterion(Y)

Simplicity criterion for varimax columns.

sort_by_eigv(L, ev)

spatspec2erpPCA(ss)

Create an erpPCA estimator from a SpatSpecDecomposition.

varimax_iter(Yo, Y)

varimax_rotation(X[, maxit, tol, norm, ...])

Varimax rotation (4M algorithm).

Classes

erpPCA([nfac, max_it, tol, verbose, ...])

Varimax-rotated PCA estimator for ECoG spatio-spectral data.