ncrf.NCRF¶
- class ncrf.NCRF(lead_field, noise_covariance, n_iter=30, n_iterc=10, n_iterf=100)¶
Result container and object-based API for NCRF.
- Parameters:
lead_field – Forward solution a.k.a. lead-field matrix, with
sensorandsourcedimensions and an optionalspacedimension for free orientation.noise_covariance – Noise covariance matrix in sensor space, typically estimated from empty-room recordings.
n_iter – Number of out iterations of the algorithm, by default set to 10.
n_iterc – Number of Champagne iterations within each outer iteration, by default set to 30.
n_iterf – Number of FASTA iterations within each outer iteration, by default set to 100.
- h¶
The neuro-current response function. It is one NDVar when fitting a single predictor and a sequence of NDVars when fitting multiple predictors.
- h_scaled¶
hwith the original stimulus scaling restored.
- explained_var¶
Fraction of total variance explained by the fitted NCRFs.
- voxelwise_explained_variance¶
Source-wise contributions to explained variance.
- Gamma¶
Individual source covariance matrices.
- sigma_b¶
Data covariance estimates under the model.
- theta¶
NCRF coefficients over the Gabor basis.
- mu¶
Regularization parameter used for the fitted model.
- residual¶
The fit error, i.e. the result of the
eval_objerror function on the final fit.
- tstart¶
TRF start time in seconds, one value per predictor.
- tstep¶
Sample spacing in seconds.
- tstop¶
TRF stop time in seconds, one value per predictor.
- basis_std¶
Standard deviation of the Gaussian basis functions in seconds.
- stim_baseline¶
Mean that was subtracted from
stim.
- stim_scaling¶
Scale by which
stimwas divided.
Notes
Usage:
Use
RegressionData.from_data()to construct a prepared dataset from MEG and stimulus segments.Initialize
NCRFwith the lead field and noise covariance.Call
NCRF.fit()with theRegressionDatainstance to estimate the cortical TRFs.Access the cortical TRFs in the
NCRF.hattribute.
Methods
|
Compute the estimation-stability metric across cross-validation folds. |
Compute the global explained-variance score for a fitted model. |
|
|
Summarize stored cross-validation scores in a table. |
|
Retrieve best mu based on cross-validation |
|
|
|
Evaluate the unweighted L2 prediction error used in CV. |
|
Evaluate the current objective value on a dataset. |
|
Fit the NCRF model to prepared regression data. |