ncrf.ForwardModel¶
- class ncrf.ForwardModel(lead_field, noise_covariance, source, sensor, space)¶
Forward model and noise covariance with derived whitened quantities.
The lead field and noise covariance are stored as supplied; the whitened quantities used by the solver are derived (and recomputed on unpickling) rather than stored. A single instance is shared read-only across cross-validation folds.
Whitening projects sensor space onto the
rankleading eigenvectors of the noise covariance, so the whitened quantities haverankrather thann_sensorschannels. For a full-rank covariance the two coincide; for a rank-deficient one (e.g. after ICA component removal, Maxwell filtering, or SSP projection) the directions without noise are dropped, as data cleaned the same way carries no signal there either. The rank is the number of eigenvalues above a small fraction of the largest, chosen to separate removed directions from measured noise (see_RANK_TOLin the source).- Parameters:
lead_field (numpy._typing._array_like.NDArray[numpy.float64]) – Forward solution as a 2-D array, shape
(n_sensors, n_sources)or(n_sensors, n_sources * len(space))for free orientation.noise_covariance (numpy._typing._array_like.NDArray[numpy.float64]) – Sensor-space noise covariance, shape
(n_sensors, n_sensors), with the channels in the order ofsensor.source (eelbrain._data_obj.SourceSpace | eelbrain._data_obj.VolumeSourceSpace) – Source dimension of the forward model.
sensor (eelbrain._data_obj.Sensor) – Sensor dimension of the forward model.
space (eelbrain._data_obj.Space | None) – Orientation dimension (
Nonefor fixed orientation).
Methods
|
Column/row slice of source |
Attributes
Number of orientation components per source. |
|
MNE-style initializer for |
|
Rank of |
|
the inverse square root of |
|
Whitened and spectrally normalized |
|
the |
|
Spectral norm removed from the whitened lead field. |