ncrf.NCRFEstimator

class ncrf.NCRFEstimator(lead_field=None, noise_covariance=None, noise_channels=None)

Estimator for neuro-current response functions (NCRFs).

Construct with from_lead_field() from a lead field and noise covariance, then call fit() with a RegressionData instance to obtain an NCRFFit.

The estimator stores its inputs in full; the whitened ForwardModel is derived by fit() for exactly the channels of the data being fit, since whitening is not separable per channel.

Parameters:
  • lead_field (eelbrain._data_obj.NDVar | None) – Full forward solution with sensor and source dimensions and an optional space dimension for free orientation.

  • noise_covariance (numpy._typing._array_like.NDArray[numpy.float64] | None) – Sensor-space noise covariance for noise_channels, in their order.

  • noise_channels (collections.abc.Sequence[str] | None) – Channel names of noise_covariance, in its order: a subset of the lead field’s channels. Alignment to the data’s channels happens by name when the forward model is derived.

Notes

Use RegressionData.from_data() to prepare the M/EEG and predictor segments, initialize this estimator with the matching forward inputs, and call fit() with a configured Solver. The returned NCRFFit keeps the reusable model separate from solver-specific fitted state.

Derived forward models are cached by channel set, so repeated fits to data with the same channels share one. The estimator’s inputs are treated as immutable; replace the estimator rather than modifying them.

Methods

fit(data, solver, *[, cv, verbose, ...])

Fit a configured solver to a regression dataset.

from_lead_field(lead_field, noise_covariance)

Construct from a lead-field NDVar and noise covariance.

Attributes

lead_field

noise_channels

noise_covariance