eelbrain.pipeline.NUTSPredictor

class eelbrain.pipeline.NUTSPredictor[source]

Non-uniform time series predictor, stored as Dataset files

NUTS predictors are specified as Dataset objects with a time column (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 sets value to zero wherever it is False). The term {key} alone invokes an intercept, i.e. a value of 1 at each time point.

Notes

See FilePredictorBase for the predictor file location.

Examples

Assume a Dataset stored at predictors/story~word.pickle, etc., with the following columns:

  • time, indicating the word’s onset time

  • frequency, the word frequency

  • surprisal, how surprising the word is in its context

  • noun, True if the word is a noun, False otherwise

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 onset

  • word-frequency: An impulse at each word onset reflecting the word’s frequency

  • word-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")