nigsp.operations.surrogates.random_sign

nigsp.operations.surrogates.random_sign(eigenvec, n_surr=1000, seed=42, stack=False)[source]

Create surrogates by randomly switching signs of eigenvectors.

Parameters:
eigenvecnumpy.ndarray

A matrix of eigenvectors.

n_surrint, optional

Number of surrogates to create.

seedint or None, optional

Random seed (for repeatability).

stackbool, optional

If True, add original eigenvec as last entry of the last dimension of the created surrogate matrix.

Returns:
numpy.ndarray

The matrix of surrogates, of shape (eigenvec * n_surr(+1),).

Raises:
NotImplementedError

If eigenvec is 4+ D.