gemmr.util.pc_spectrum_decay_constant
- gemmr.util.pc_spectrum_decay_constant(X=None, pc_spectrum=None, expl_var_ratios=(0.3, 0.9), plot=False)
Estimate powerlaw decay constant.
- Parameters:
X (np.ndarray (n_samples, n_features)) – the principal component spectrum will be estimated for data matrix
X
. EitherX
orpc_spectrum
must be givenpc_spectrum (np.ndarray (n_pcs,)) – directly the principal component spectrum. Either
X
orpc_spectrum
must be givenexpl_var_ratios (tuple of floats) – decay constants will be estimated by fitting a linear regression to the principal component spectrum using the number of components that explain this amount of variance. If multiple values for
expl_var_ratios
are given, multiple decay constants will be returnedplot (bool) – if
True
, a plot of the spectrum and illustrating the decay constant will be returned in addition to the decay constant
- Returns:
decay_constant (np.ndarray (len(expl_var_ratios),)) – estimated powerlaw decay constant
panel (hv.Overlay) – if argument
plot == True
, a panel showing the principal component spectrum and illustrating the decay constant