MCPcopy
hub / github.com/mne-tools/mne-python / compute_whitener

Function compute_whitener

mne/cov.py:2200–2320  ·  view source on GitHub ↗

Compute whitening matrix. Parameters ---------- noise_cov : Covariance The noise covariance. %(info)s Can be None if ``noise_cov`` has already been prepared with :func:`prepare_noise_cov`. %(picks_good_data_noref)s %(rank_none)s .. versionadded:: 0.1

(
    noise_cov,
    info=None,
    picks=None,
    rank=None,
    scalings=None,
    return_rank=False,
    pca=False,
    return_colorer=False,
    on_rank_mismatch="warn",
    verbose=None,
)

Source from the content-addressed store, hash-verified

2198
2199@verbose
2200def compute_whitener(
2201 noise_cov,
2202 info=None,
2203 picks=None,
2204 rank=None,
2205 scalings=None,
2206 return_rank=False,
2207 pca=False,
2208 return_colorer=False,
2209 on_rank_mismatch="warn",
2210 verbose=None,
2211):
2212 """Compute whitening matrix.
2213
2214 Parameters
2215 ----------
2216 noise_cov : Covariance
2217 The noise covariance.
2218 %(info)s Can be None if ``noise_cov`` has already been
2219 prepared with :func:`prepare_noise_cov`.
2220 %(picks_good_data_noref)s
2221 %(rank_none)s
2222
2223 .. versionadded:: 0.18
2224 Support for 'info' mode.
2225 scalings : dict | None
2226 The rescaling method to be applied. See documentation of
2227 ``prepare_noise_cov`` for details.
2228 return_rank : bool
2229 If True, return the rank used to compute the whitener.
2230
2231 .. versionadded:: 0.15
2232 pca : bool | str
2233 Space to project the data into. Options:
2234
2235 :data:`python:True`
2236 Whitener will be shape (n_nonzero, n_channels).
2237 ``'white'``
2238 Whitener will be shape (n_channels, n_channels), potentially rank
2239 deficient, and have the first ``n_channels - n_nonzero`` rows and
2240 columns set to zero.
2241 :data:`python:False` (default)
2242 Whitener will be shape (n_channels, n_channels), potentially rank
2243 deficient, and rotated back to the space of the original data.
2244
2245 .. versionadded:: 0.18
2246 return_colorer : bool
2247 If True, return the colorer as well.
2248 %(on_rank_mismatch)s
2249 %(verbose)s
2250
2251 Returns
2252 -------
2253 W : ndarray, shape (n_channels, n_channels) or (n_nonzero, n_channels)
2254 The whitening matrix.
2255 ch_names : list
2256 The channel names.
2257 rank : int

Callers 14

test_sss_projFunction · 0.90
test_compute_whitenerFunction · 0.90
test_cov_orderFunction · 0.90
whiten_evokedFunction · 0.85
compute_chpi_locsFunction · 0.85
fit_dipoleFunction · 0.85
compute_depth_priorFunction · 0.85
_compute_pre_whitenerMethod · 0.85
prepare_inverse_operatorFunction · 0.85
_prepare_forwardFunction · 0.85
_handle_restr_matFunction · 0.85

Calls 7

_validate_typeFunction · 0.85
_picks_to_idxFunction · 0.85
prepare_noise_covFunction · 0.85
sqrtMethod · 0.80
infoMethod · 0.80
copyMethod · 0.45
sumMethod · 0.45

Tested by 4

test_sss_projFunction · 0.72
test_compute_whitenerFunction · 0.72
test_cov_orderFunction · 0.72