Regularize noise covariance matrix. This method works by adding a constant to the diagonal for each channel type separately. Special care is taken to keep the rank of the data constant. .. note:: This function is kept for reasons of backward-compatibility. Please cons
(
cov,
info,
mag=0.1,
grad=0.1,
eeg=0.1,
exclude="bads",
proj=True,
seeg=0.1,
ecog=0.1,
hbo=0.1,
hbr=0.1,
fnirs_cw_amplitude=0.1,
fnirs_fd_ac_amplitude=0.1,
fnirs_fd_phase=0.1,
fnirs_od=0.1,
csd=0.1,
dbs=0.1,
rank=None,
scalings=None,
verbose=None,
)
| 1919 | |
| 1920 | @verbose |
| 1921 | def regularize( |
| 1922 | cov, |
| 1923 | info, |
| 1924 | mag=0.1, |
| 1925 | grad=0.1, |
| 1926 | eeg=0.1, |
| 1927 | exclude="bads", |
| 1928 | proj=True, |
| 1929 | seeg=0.1, |
| 1930 | ecog=0.1, |
| 1931 | hbo=0.1, |
| 1932 | hbr=0.1, |
| 1933 | fnirs_cw_amplitude=0.1, |
| 1934 | fnirs_fd_ac_amplitude=0.1, |
| 1935 | fnirs_fd_phase=0.1, |
| 1936 | fnirs_od=0.1, |
| 1937 | csd=0.1, |
| 1938 | dbs=0.1, |
| 1939 | rank=None, |
| 1940 | scalings=None, |
| 1941 | verbose=None, |
| 1942 | ): |
| 1943 | """Regularize noise covariance matrix. |
| 1944 | |
| 1945 | This method works by adding a constant to the diagonal for each |
| 1946 | channel type separately. Special care is taken to keep the |
| 1947 | rank of the data constant. |
| 1948 | |
| 1949 | .. note:: This function is kept for reasons of backward-compatibility. |
| 1950 | Please consider explicitly using the ``method`` parameter in |
| 1951 | :func:`mne.compute_covariance` to directly combine estimation |
| 1952 | with regularization in a data-driven fashion. See the |
| 1953 | :ref:`FAQ <faq_how_should_i_regularize>` for more information. |
| 1954 | |
| 1955 | Parameters |
| 1956 | ---------- |
| 1957 | cov : Covariance |
| 1958 | The noise covariance matrix. |
| 1959 | %(info_not_none)s (Used to get channel types and bad channels). |
| 1960 | mag : float (default 0.1) |
| 1961 | Regularization factor for MEG magnetometers. |
| 1962 | grad : float (default 0.1) |
| 1963 | Regularization factor for MEG gradiometers. Must be the same as |
| 1964 | ``mag`` if data have been processed with SSS. |
| 1965 | eeg : float (default 0.1) |
| 1966 | Regularization factor for EEG. |
| 1967 | exclude : list | 'bads' (default 'bads') |
| 1968 | List of channels to mark as bad. If 'bads', bads channels |
| 1969 | are extracted from both info['bads'] and cov['bads']. |
| 1970 | proj : bool (default True) |
| 1971 | Apply projections to keep rank of data. |
| 1972 | seeg : float (default 0.1) |
| 1973 | Regularization factor for sEEG signals. |
| 1974 | ecog : float (default 0.1) |
| 1975 | Regularization factor for ECoG signals. |
| 1976 | hbo : float (default 0.1) |
| 1977 | Regularization factor for HBO signals. |
| 1978 | hbr : float (default 0.1) |