nstat.TrialConfig
- class nstat.TrialConfig(covMask=None, sampleRate=None, history=None, ensCovHist=None, ensCovMask=None, covLag=None, name='')[source]
Bases:
objectDescription of a single GLM fit configuration.
A
TrialConfigspecifies which covariates, history, ensemble history, and sample rate to apply to aTrialbefore fitting. MultipleTrialConfigobjects are collected in aConfigCollectionto run a batch of nested-model comparisons.- Parameters:
covMask (sequence of str or nested sequences, or None) – Covariate labels to include in the design matrix.
'all'includes every covariate.sampleRate (float or None) – If provided, the trial is resampled to this rate before fitting.
history (History or array_like or None) – Self-history specification (History object or window-times).
ensCovHist (History or array_like or None) – Ensemble-history specification.
ensCovMask (array_like or None) – Binary mask selecting which neighbours contribute ensemble history.
covLag (array_like or None) – Covariate shift / lag specification.
name (str) – Human-readable name for this configuration.
- __init__(covMask=None, sampleRate=None, history=None, ensCovHist=None, ensCovMask=None, covLag=None, name='')[source]
Construct a single GLM-fit configuration (Matlab
TrialConfig).- Parameters:
covMask (sequence of str, nested sequences, or None, optional) – Names of the covariates (and channels) to include in the design matrix.
Noneor[](the empty list) is the “unset” sentinel and leaves the mask empty. Use the literal string'all'to include every covariate in aCovariateCollection.sampleRate (float or None, optional) – Target sample rate in Hz to resample the trial to before fitting.
Noneleaves the trial’s existing rate unchanged.history (History, array_like, or None, optional) – Self-history specification. May be a
Historyobject or a vector of window boundary times in seconds.ensCovHist (History, array_like, or None, optional) – Ensemble-history specification.
ensCovMask (array_like or None, optional) – Binary mask selecting which neighbour neurons contribute ensemble-history terms.
covLag (array_like or None, optional) – Per-covariate time shifts (covariate lags) in seconds.
name (str, optional) – Human-readable name for this configuration (appears in
FitResultplots). Default"".
- Return type:
None
Notes
Nonearguments are normalised to the empty list[]to match the MATLAB sentinel convention recognised by_is_empty_config_value().See also
ConfigCollectionOrdered collection used to compare configurations.
Trial.setConfigApply a single
TrialConfigto a trial.
- setConfig(trial)[source]
Apply this configuration to a Trial (in place).
Sets the covariate mask, history, ensemble history, sample rate, and covariate lag on the trial.
- Parameters:
trial (Trial)
- Return type:
None
- setName(name)[source]
Set this configuration’s human-readable name.
- Parameters:
name (str)
- Return type:
None
- static fromStructure(structure)[source]
Reconstruct from a dict produced by
toStructure().Note
Follows Matlab’s omission of
ensCovMask.- Parameters:
- Return type: