eelbrain.pipeline.NUTSPredictor
- class eelbrain.pipeline.NUTSPredictor[source]
Non-uniform time series predictor, stored as
DatasetfilesNUTS predictors are specified as
Datasetobjects with atimecolumn (time stamp of each event in seconds) and further columns with event values. When loading a predictor, they are converted to uniform time series by placing impulses at the time stamps. The columns to use are specified in the model term, as{key}-{value-column}or{key}-{value-column}-{mask-column}(the boolean mask column setsvalueto zero wherever it isFalse). The term{key}alone invokes an intercept, i.e. a value of 1 at each time point.Notes
See
FilePredictorBasefor the predictor file location.Examples
Assume a
Datasetstored atpredictors/story~word.pickle, etc., with the following columns:time, indicating the word’s onset timefrequency, the word frequencysurprisal, how surprising the word is in its contextnoun,Trueif the word is a noun,Falseotherwise
This could be added to the experiment as follows:
predictors = { 'word': NUTSPredictor(), }
With this predictor, the following terms could be used for TRF models:
word: Unit size impulse at every word onsetword-frequency: An impulse at each word onset reflecting the word’s frequencyword-frequency-noun: An impulse at each noun’s onset reflecting the noun’s frequency
These terms in turn could be used to construct the following model:
experiment.load_trfs(x="word + word-frequency + word-surprisal")