EEGdashNeMARON008083
Iss. 8083 · 43 subjects · 43 recordings · CC0
Dataset Brief · Hierarchical Priors in Perceptual Uncertainty and Psychosis P…

ON008083: eeg dataset, 43 subjects#

Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors

Access recordings and metadata through EEGDash.

Citation: Jonathan Buchholz, Guido Hesselmann (2023). Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors. 10.82901/nemar.on008083

Modality: eeg Subjects: 43 Recordings: 43 License: CC0 Source: nemar

Metadata: Complete (100%)

43-participant EEG dataset — Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors.

EEG · 31 ch1000 HzBIDS 1.9.0Task · HierPrior
Layer 01Study
What was asked
Hypothesis, independent & dependent variables, paradigm, cohort, and the editorial caveats around what the recordings can and cannot answer.
Layer 02Signal · BIDS
What was recorded
Sidecars, channels & electrodes, coordinate system, event semantics, and quality stats from the NEMAR pipeline when available.
Layer 03Training · ML
What you can train on
Recommended access modes — MNE Raw, braindecode windows, PyTorch DataLoader — plus the targets the metadata makes addressable.
§ 01Access · Get started

Quickstart#

Install

pip install eegdash

Access the data

from eegdash.dataset import ON008083

dataset = ON008083(cache_dir="./data")
# Get the raw object of the first recording
raw = dataset.datasets[0].raw
print(raw.info)

Filter by subject

dataset = ON008083(cache_dir="./data", subject="01")

Advanced query

dataset = ON008083(
    cache_dir="./data",
    query={"subject": {"$in": ["01", "02"]}},
)

Iterate recordings

for rec in dataset:
    print(rec.subject, rec.raw.info['sfreq'])

If you use this dataset in your research, please cite the original authors.

BibTeX

@dataset{on008083,
  title = {Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors},
  author = {Jonathan Buchholz and Guido Hesselmann},
  doi = {10.82901/nemar.on008083},
  url = {https://doi.org/10.82901/nemar.on008083},
}
§ 02Study · The README

About This Dataset#

This file provides a experimental guide linking the analysis of Buchholz & Hesselmann (in review) - Hierarchical Priors Shape Dynamic Evidence Accumulation and Aperiodic EEG Activity with the here provided data and code. This can be used as an assisting tool for first running a semi-automated BIDS-EEG pipeline.

This EEG-BIDS dataset contains cue-locked EEG recordings and event annotations from a random-dot kinematogram (RDK) task designed to dissociate low-level and high-level priors during perceptual decision-making. The accompanying analysis tests whether hierarchical priors bias behavior through signal detection theory (SDT) and generalized drift-diffusion modeling (gDDM), and whether they modulate occipital oscillatory or aperiodic EEG activity.

The trial-level variables needed for analysis are stored in epochs.metadata and are illustrated by the accompanying metadata.csv file. Each row corresponds to one cue-locked epoch/trial retained in the MNE Epochs object. Participant-level questionnaire and trait variables are stored in trait_variables.csv, with one row per participant. Additionally, trigger codes stored as annotations enable (less flexible) trial-wise analyses.

DOI

README: Experiment Guide — Hierarchical Priors RDK EEG Task

Data collection

Data were collected from neurotypical adults with normal or corrected-to-normal vision and no neurological or psychiatric diagnoses. Fifty-three participants were tested; twelve were excluded for failing the preregistered discrimination-performance criterion, leaving 43 participants in the final sample (27 female, 1 trans; mean age 24.47 +/- 5.46 years). Participants gave written informed consent, were tested in the EEG laboratory of Psychologische Hochschule Berlin, and received course credit or monetary compensation.

Stimuli were random-dot kinematograms (RDKs) with 1200 white dots (0.078 deg; 2.53 deg/s) presented inside a circular aperture (radius 9.09 deg). A subset of dots moved coherently leftward or rightward while the remaining dots moved randomly; dot lifetime was limited to 24 frames (~100 ms). Stimuli were presented with PsychoPy on a 24.5-inch LCD monitor (240 Hz refresh rate) at a fixed viewing distance of 65 cm. Auditory cues were delivered for 500 ms at 84.8 dB(A); each trial then included an approximately 1000 ms fixation-only interval, RDK presentation for up to approximately 3000 ms or until response, and a jittered 1000-1500 ms intertrial interval. The experiment used a within-subject design with three conditions: baseline/no prior, low-level prior, and high-level prior. Baseline blocks used a neutral 750 Hz tone and comprised 8 blocks of 20 trials. Low-level priors were induced implicitly by 600/900 Hz tones that predicted leftward or rightward motion with 75% contingency; tone-motion mappings were counterbalanced, learned across 3 blocks of 20 trials, and tested across 8 blocks of 20 trials. High-level priors were induced by a standardized cover story about tinted glasses that allegedly enhanced leftward or rightward motion; beliefs were reinforced across 4 learning blocks of 20 trials and tested across 8 blocks of 20 trials. Condition order was fully counterbalanced, and 160 trials per condition entered the main analyses.

View full README

DOI

README: Experiment Guide — Hierarchical Priors RDK EEG Task

Data collection

Data were collected from neurotypical adults with normal or corrected-to-normal vision and no neurological or psychiatric diagnoses. Fifty-three participants were tested; twelve were excluded for failing the preregistered discrimination-performance criterion, leaving 43 participants in the final sample (27 female, 1 trans; mean age 24.47 +/- 5.46 years). Participants gave written informed consent, were tested in the EEG laboratory of Psychologische Hochschule Berlin, and received course credit or monetary compensation.

Stimuli were random-dot kinematograms (RDKs) with 1200 white dots (0.078 deg; 2.53 deg/s) presented inside a circular aperture (radius 9.09 deg). A subset of dots moved coherently leftward or rightward while the remaining dots moved randomly; dot lifetime was limited to 24 frames (~100 ms). Stimuli were presented with PsychoPy on a 24.5-inch LCD monitor (240 Hz refresh rate) at a fixed viewing distance of 65 cm. Auditory cues were delivered for 500 ms at 84.8 dB(A); each trial then included an approximately 1000 ms fixation-only interval, RDK presentation for up to approximately 3000 ms or until response, and a jittered 1000-1500 ms intertrial interval. The experiment used a within-subject design with three conditions: baseline/no prior, low-level prior, and high-level prior. Baseline blocks used a neutral 750 Hz tone and comprised 8 blocks of 20 trials. Low-level priors were induced implicitly by 600/900 Hz tones that predicted leftward or rightward motion with 75% contingency; tone-motion mappings were counterbalanced, learned across 3 blocks of 20 trials, and tested across 8 blocks of 20 trials. High-level priors were induced by a standardized cover story about tinted glasses that allegedly enhanced leftward or rightward motion; beliefs were reinforced across 4 learning blocks of 20 trials and tested across 8 blocks of 20 trials. Condition order was fully counterbalanced, and 160 trials per condition entered the main analyses.

Before the experiment, individual motion sensitivity was estimated with two 40-trial QUEST staircases targeting 75% discrimination accuracy. The final threshold defined medium coherence; low and high coherence were 50% and 200% of this threshold, respectively. Learning blocks overrepresented medium- and high-coherence trials to support prior acquisition, whereas baseline and test blocks overrepresented low-coherence trials and contained no high-coherence trials to increase reliance on prior information. Continuous EEG was recorded from 31 active Ag/AgCl electrodes arranged according to the international 10/20 system using an actiChamp Plus amplifier at 1000 Hz. The ground electrode was placed at FPz and data were online referenced to FCz. Electrode impedances were kept below 20 kOhm, and participants were instructed to minimize blinks, saccades, muscle activity, and body movement during recording. Post-experimental questionnaires assessed demographics, manipulation checks, belief strength, psychosis proneness, and psychological flexibility/inflexibility traits. These participant-level variables are documented in [trait_variables.csv](#traits_cleancsv-questionnaire-and-trait-column-dictionary).

Task summary

Each trial followed this sequence: 1. auditory cue/tone onset; 2. fixation-only interstimulus interval (ISI; approximately 1000 ms); 3. RDK onset with leftward or rightward net motion at individualized coherence; 4. left/right response, followed by a jittered intertrial interval (ITI; approximately 1000–1500 ms).

Motion coherence was individualized with two QUEST staircases targeting 75% discrimination accuracy. The resulting threshold defined the medium coherence level. Low coherence was 50% of this threshold; high coherence was 200% of this threshold.

The experiment contained three within-subject conditions: - Baseline / no prior (exp = base): a neutral, nonpredictive 750 Hz tone preceded the RDK. - Low-level prior (exp = lowlevel): two tones (600/900 Hz) predicted leftward or rightward motion with 75% contingency. Participants were not informed about the tone-motion association. - High-level prior (exp = highlevel): the tone was neutral/nonpredictive, but participants wore transparent tinted glasses and were led to believe that the glasses enhanced perception of either leftward or rightward motion. This belief was reinforced during learning blocks before the analyzed test blocks.

The main analyses use baseline trials and prior-condition test trials. Learning blocks served to establish the tone-motion associations or glass beliefs and should not be included unless explicitly intended.

Raw BIDS events

Each *_events.tsv file contains raw trigger-level events, and the *_events.json sidecar defines the BIDS event columns. Events are stored under sub-0XX/ses-01/eeg/. BIDS naming note: the provided example sidecar is named task-RDK_events.json, whereas the provided example events file is named task-HierPrior_events.tsv. For strict BIDS compatibility, task labels should be identical across the EEG data file, events file, and JSON sidecar.

Event columns

| Column       | Meaning                                                           |
| ------------ | ----------------------------------------------------------------- |
| `onset`      | Event onset in seconds from the first stored data point.          |
| `duration`   | Event duration in seconds. Non-informative in this dataset        |
| `sample`     | Event onset in sampling points; first sample is 0.                |
| `value`      | Numeric trigger/event code.                                       |
| `trial_type` | Human-readable trigger label, for example `S_1`, `S_8`, or `R_1`. |

Trigger codes

| `value` | `trial_type` | Meaning                                                                                               |
| ------- | ------------ | ----------------------------------------------------------------------------------------------------- |
| 1       | `S_1`        | left prior; tone (600/900 Hz) for low-level / left-enhancing glasses for high-level prior condition   |
| 2       | `S_2`        | right prior; tone (600/900 Hz) for low-level / right-enhancing glasses for high-level prior condition |
| 4       | `S_4`        | no prior; 750 Hz tone cue onset in baseline.                                                          |
| 8       | `S_8`        | RDK onset with leftward net motion.                                                                   |
| 16      | `S_16`       | RDK onset with rightward net motion.                                                                  |
| 101     | `R_1`        | Correct response.                                                                                     |
| 102     | `R_2`        | Incorrect response.                                                                                   |

A raw trial can be reconstructed as: cue event (S_1/S_2/S_4) RDK event (S_8/S_16) response event (R_1/R_2, if present) For manuscript-level reproduction, use epochs.metadata rather than only the raw triggers, because the metadata contains condition labels, prior direction, motion coherence, counterbalancing, response direction, and behavioral exclusion flags.

epochs.metadata column dictionary

The table below explains the columns in metadata.csv, which are attached to each cue-locked MNE Epochs object as epochs.metadata. Values shown are examples from the supplied file; levels may vary across participants.

| Column                | Example values / type                | Meaning                                                                                                                                                                                                                                                      | Use for reproduction                                                                                              |
| --------------------- | ------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
| `trigger`             | `1`                                  | Technical event identifier used during cue-locked epoch creation. In the provided metadata this is constant because epochs are anchored to cue onset.                                                                                                        | Bookkeeping only. Use `exp`, `cueHz`, and `prior` for analysis coding.                                            |
| `participant`         | `sub-001`                            | BIDS participant label.                                                                                                                                                                                                                                      | Grouping variable for participant-level SDT, gDDM, EEG, and spectral summaries; merge key for questionnaire data. |
| `exp`                 | `base`, `lowlevel`, `highlevel`      | Experimental condition: baseline/no prior, implicit low-level prior, or explicit high-level prior.                                                                                                                                                           | Primary within-subject factor `prior condition` in behavioral and EEG analyses.                                   |
| `block_cond`          | `base`, `test`                       | Analysis phase/block type. Baseline blocks are coded `base`; analyzed prior-condition test blocks are coded `test`.                                                                                                                                          | Keep `base` and `test` rows for the main analyses; exclude learning blocks if present in other metadata files.    |
| `block_order`         | e.g., `bhl`                          | Counterbalanced order of the three conditions. Letters denote baseline (`b`), high-level (`h`), and low-level (`l`).                                                                                                                                         | Optional check for order effects; not a primary manuscript variable.                                              |
| `thisN`               | `0`–`19`                             | Trial index within the current 20-trial block as generated by the task script.                                                                                                                                                                               | Trial-order diagnostics and within-block checks.                                                                  |
| `cueAss`              | e.g., `highleft`                     | Low-level tone-motion counterbalancing. `highleft` means the high tone predicted leftward motion and the low tone predicted rightward motion.                                                                                                                | Reconstruct or validate `prior` in low-level prior trials from `cueHz`.                                           |
| `cueHz`               | `600`, `750`, `900`                  | Auditory cue frequency in Hz. `750` is neutral/nonpredictive; `600` and `900` are predictive low-level prior cues.                                                                                                                                           | Validate cue condition; reconstruct low-level prior direction together with `cueAss`.                             |
| `motion_direction`    | `left`, `right`                      | Physical net direction of RDK motion on the trial.                                                                                                                                                                                                           | Stimulus direction for accuracy, SDT signal coding, and prior congruency.                                         |
| `prior`               | `noprior`, `left`, `right`           | Direction predicted by the current prior. `noprior` is used in baseline trials; `left`/`right` indicate the tone-predicted or glasses-predicted direction.                                                                                                   | Defines prior-congruent versus prior-incongruent stimuli and responses.                                           |
| `response`            | `left`, `right`, missing             | Participant's reported perceived motion direction.                                                                                                                                                                                                           | Behavioral choice variable for SDT and gDDM. Exclude missing responses for behavioral modeling.                   |
| `corr`                | `0`, `1`                             | Accuracy relative to physical RDK direction: `1` = response matches `motion_direction`; `0` = incorrect.                                                                                                                                                     | Performance checks and inclusion diagnostics.                                                                     |
| `rt`                  | seconds                              | Reaction time from RDK onset to button response.                                                                                                                                                                                                             | gDDM response-time variable and RT outlier screening.                                                             |
| `thresh75`            | participant-specific proportion      | Individual QUEST threshold targeting 75% correct discrimination. This is the participant's medium coherence.                                                                                                                                                 | Defines individualized sensory uncertainty; `medium = thresh75`, `low = 0.5 × thresh75`, `high = 2 × thresh75`.   |
| `BiasFirst`           | e.g., `rightfirst`, `leftfirst`      | Counterbalancing/order variable for the high-level glasses manipulation, indicating which glasses/prior direction was introduced or tested first.                                                                                                            | Optional check for high-level prior order effects.                                                                |
| `coh`                 | proportion, e.g., `0.0562`, `0.1124` | Trial-wise RDK motion coherence.                                                                                                                                                                                                                             | Continuous sensory-evidence strength; drift rate was modeled as a function of coherence in the gDDM.              |
| `coh_level`           | `low`, `medium`, `high`              | Categorical coherence level derived from `thresh75`. In analyzed test trials, low and medium coherence are expected.                                                                                                                                         | Descriptive performance checks and model validation by coherence level.                                           |
| `filename`            | e.g., `sub-001_RDKdeutsch_highleft`  | Source behavioral/task-log identifier. Usually contains participant and counterbalancing information.                                                                                                                                                        | Provenance and debugging.                                                                                         |
| `rt_flag`             | `False`, `True`                      | Trial-level behavioral exclusion flag. `True` marks trials excluded because of missing responses or RT outlier criteria.                                                                                                                                     | For behavioral SDT/gDDM reproduction, use `rt_flag == False` with nonmissing `rt` and `response`.                 |
| `lowCoh_performance`  | proportion correct                   | Participant-level accuracy at low coherence, repeated across rows for that participant.                                                                                                                                                                      | Inclusion/performance diagnostics; used to verify monotonic performance across coherence levels.                  |
| `medCoh_performance`  | proportion correct                   | Participant-level accuracy at medium coherence, repeated across rows for that participant.                                                                                                                                                                   | Inclusion/performance diagnostics.                                                                                |
| `highCoh_performance` | proportion correct                   | Participant-level accuracy at high coherence, repeated across rows for that participant.                                                                                                                                                                     | Inclusion/performance diagnostics; should exceed medium and low coherence performance.                            |
| `prior_dic`           | `noprior`, `prior`                   | Binary prior grouping: baseline/no-prior versus any prior condition.                                                                                                                                                                                         | Convenience grouping only. Use `exp` to distinguish low-level from high-level priors.                             |
| `response_prior`      | `0`, `1`, missing                    | Response recoded relative to the prior-defined decision bound. In prior conditions, `1` = response in the prior-congruent direction and `0` = response in the prior-incongruent direction. In baseline trials, `1` = left response and `0` = right response. | Primary binary response variable for SDT and gDDM boundary coding.                                                |

trait_variables.csv questionnaire and trait column dictionary

trait_variables.csv contains participant-level questionnaire, demographic, belief-strength, and trait data. The supplied file has 43 rows and 347 columns. Each row corresponds to one participant. Merge it with trial-level metadata by matching trait_variables.csv:participant to metadata.csv / epochs.metadata:participant.

Column naming conventions and coding

| Column(s) / pattern             | Columns in supplied file | Values / coding                                                            | Meaning and recommended use                                                                                                                                                                                                                                                                                            |
| ------------------------------- | ------------------------ | -------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `participant`                   | 1                        | `sub-001`, `sub-003`, ...                                                  | Participant identifier. Use as the merge key for questionnaire data; corresponds to `participant` in `epochs.metadata`.                                                                                                                                                                                                |
| `gender`                        | 1                        | `female`, `male`, `trans`                                                  | Self-reported gender category as stored in the questionnaire export.                                                                                                                                                                                                                                                   |
| `education`                     | 1                        | `fhr_abi`, `uni`                                                           | Self-reported education category as stored in the questionnaire export.                                                                                                                                                                                                                                                |
| `highprior_strength`            | 1                        | VAS 0-100; observed range in this file: 0-75                               | Strength of the participant's belief in the allegedly motion-altering glasses. Higher values indicate stronger belief. This is the high-level-prior manipulation-check / belief-strength variable.                                                                                                                     |
| `pdi_<item>0`                   | 40                       | `0` = no, `1` = yes                                                        | Peters et al. Delusions Inventory (PDI) endorsement item. `<item>` runs from `01` to `40`; for example, `pdi_010` is item 01 endorsement. Use these columns to compute the PDI endorsement sum score.                                                                                                                  |
| `pdi_<item>1`                   | 40                       | 1-5 if the item was endorsed; missing otherwise                            | PDI distress rating for the corresponding endorsed belief/experience; for example, `pdi_011` is distress for item 01.                                                                                                                                                                                                  |
| `pdi_<item>2`                   | 40                       | 1-5 if the item was endorsed; missing otherwise                            | PDI preoccupation rating: how often the participant thinks about the corresponding belief/experience; for example, `pdi_012` is preoccupation for item 01.                                                                                                                                                             |
| `pdi_<item>3`                   | 40                       | 1-5 if the item was endorsed; missing otherwise                            | PDI conviction rating: how true the participant believes the corresponding thought is; for example, `pdi_013` is conviction for item 01.                                                                                                                                                                               |
| `caps_<item>0`                  | 32                       | `0` = no, `1` = yes                                                        | Cardiff Anomalous Perceptions Scale (CAPS) endorsement item. `<item>` runs from `01` to `32`; for example, `caps_010` is item 01 endorsement. Use these columns to compute the CAPS endorsement sum score.                                                                                                             |
| `caps_<item>1`                  | 32                       | 1-5 if the item was endorsed; missing otherwise                            | CAPS distress rating for the corresponding endorsed anomalous perceptual experience; for example, `caps_011` is distress for item 01.                                                                                                                                                                                  |
| `caps_<item>2`                  | 32                       | 1-5 if the item was endorsed; missing otherwise                            | CAPS intrusiveness rating for the corresponding endorsed anomalous perceptual experience; for example, `caps_012` is intrusiveness for item 01.                                                                                                                                                                        |
| `caps_<item>3`                  | 32                       | 1-5 if the item was endorsed; missing otherwise                            | CAPS frequency rating for the corresponding endorsed anomalous perceptual experience; for example, `caps_013` is frequency for item 01.                                                                                                                                                                                |
| `<mpfi_subscale>_<pair>_<item>` | 55                       | 1-6; `1` = never true / `Traf nie zu`, `6` = always true / `Traf immer zu` | Multidimensional Psychological Flexibility Inventory (MPFI) items. The first part gives the subscale, the middle integer links flexible and inflexible counterparts, and the final two digits give the item number within that subscale. One participant in the supplied file has missing values for all MPFI columns. |

MPFI subscale coding

The MPFI columns use matched flexible/inflexible process pairs. Matching values of the middle integer identify corresponding Hexaflex components.

| Pair index | Flexible MPFI subscale                                                          | Inflexible MPFI subscale                               | Construct pair                                                                                   |
| ---------- | ------------------------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `1`        | `accept_1_`* — acceptance *(not present in the supplied `trait_variables.csv`)* | `avoidance_1_`* — experiential avoidance               | Opening up to difficult private experiences vs. trying to avoid or suppress them.                |
| `2`        | `aware_2_*` — present-moment awareness                                          | `moment_2_*` — lack of contact with the present moment | Being attentive to ongoing thoughts and feelings vs. being disconnected from the present moment. |
| `3`        | `context_3_*` — self-as-context                                                 | `content_3_*` — self-as-content                        | Taking a broader perspective on self/experience vs. being caught in self-evaluative content.     |
| `4`        | `defusion_4_*` — defusion                                                       | `fusion_4_*` — cognitive fusion                        | Noticing thoughts and feelings without being dominated by them vs. getting stuck in them.        |
| `5`        | `values_5_*` — values                                                           | `lackvalues_5_*` — lack of contact with values         | Staying connected to what matters vs. losing contact with personally meaningful directions.      |
| `6`        | `action_6_*` — committed action                                                 | `inaction_6_*` — inaction                              | Persisting in valued action vs. not acting in line with what matters.                            |

Psychosis-proneness score from trait_variables.csv

Psychosis proneness was assessed as a composite score derived from the PDI and CAPS endorsement sum scores, weighted by their relative number of items, following Eckert et al. (2023). This composite measure was then z-transformed before further processing. In practice, compute participant-level PDI and CAPS endorsement sums from the *0 columns, weight them by scale length so that the 40-item PDI and 32-item CAPS contribute comparably, and then z-transform the resulting composite across participants.

import numpy as np
from scipy.stats import zscore
pdi_endorsement_cols = [c for c in traits.columns if c.startswith("pdi_") and c.endswith("0")]
caps_endorsement_cols = [c for c in traits.columns if c.startswith("caps_") and c.endswith("0")]

z-transformation & weighted sums

for col in score_cols:

mean = traits[col].mean() std = traits[col].std() traits[f’z_{col}’] = (traits[col] - mean) / std # z-transform

weigthed pdi & caps (according to relative contribution to total item number)

match col:
case ‘pdi_0_sum’:

traits[f’weight_{col}’] = (traits[col] * (40/72))

case ‘caps_0_sum’:

traits[f’weight_{col}’] = (traits[col] * (32/72))

traits[‘psych_prone’] = traits[‘pdi_0_sum’] + traits[‘caps_0_sum’] traits[‘z_psych_prone’] = traits[‘z_pdi_0_sum’] + traits[‘z_caps_0_sum’] traits[‘weighted_psych_prone’] = traits[‘weight_pdi_0_sum’] + traits[‘weight_caps_0_sum’]

Use psychosis_proneness_z for the manuscript-level correlations with participant-level prior effects. Use highprior_strength separately when testing whether subjective belief in the glasses relates to high-level prior effects.

Reproducing the manuscript analyses from metadata

1. Recommended trial filters

For behavioral SDT and gDDM analyses, start from the metadata table and retain analyzed trials:

meta_beh = metadata.query("exp in ['base', 'lowlevel', 'highlevel']").copy()
meta_beh = meta_beh.query("block_cond in ['base', 'test']").copy()
meta_beh = meta_beh[meta_beh['rt_flag'] == False]
meta_beh = meta_beh.dropna(subset=['response', 'rt', 'response_prior'])

When using preprocessed MNE Epochs, the rows in epochs.metadata remain aligned to the retained EEG epochs. If the exact manuscript behavioral analyses were run before EEG epoch rejection, a complete behavioral log may be needed to reproduce those behavioral trial counts exactly.

2. Manuscript variables and metadata columns

| Manuscript variable / analysis concept | Metadata column(s)                                                | Coding / transformation                                                                                                                                                        |
| -------------------------------------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Participant                            | `participant`                                                     | Group all first-level estimates by participant.                                                                                                                                |
| Prior condition                        | `exp`                                                             | `base` = baseline/no prior; `lowlevel` = low-level prior; `highlevel` = high-level prior.                                                                                      |
| Baseline/no-prior trials               | `exp == 'base'`, `prior == 'noprior'`, `cueHz == 750`             | Neutral tone, no directional prediction.                                                                                                                                       |
| Low-level prior trials                 | `exp == 'lowlevel'`, `cueHz in [600, 900]`                        | Tone direction mapping is encoded in `cueAss`; final predicted direction is already stored in `prior`.                                                                         |
| High-level prior trials                | `exp == 'highlevel'`, `cueHz == 750`, `prior in ['left','right']` | Directional prediction comes from the alleged motion-enhancing glasses, not from the tone.                                                                                     |
| Motion direction                       | `motion_direction`                                                | Physical RDK direction: left or right.                                                                                                                                         |
| Prior direction                        | `prior`                                                           | Direction predicted by tone or glasses; `noprior` for baseline.                                                                                                                |
| Response direction                     | `response`                                                        | Participant's left/right report.                                                                                                                                               |
| Accuracy                               | `corr`                                                            | `1` if `response == motion_direction`, else `0`.                                                                                                                               |
| RT                                     | `rt`                                                              | Seconds from RDK onset to response.                                                                                                                                            |
| RT/response exclusion                  | `rt_flag`, `response`, `rt`                                       | Exclude `rt_flag == True` and missing values.                                                                                                                                  |
| Sensory precision / motion coherence   | `coh`, `coh_level`, `thresh75`                                    | Use continuous `coh` for gDDM drift modulation; use `coh_level` for descriptive checks.                                                                                        |
| Prior-congruent stimulus               | `motion_direction`, `prior`, `exp`                                | Prior conditions: `motion_direction == prior`; baseline: `motion_direction == 'left'` for SDT coding.                                                                          |
| Prior-congruent response               | `response_prior`                                                  | Prior conditions: `1` = response matches `prior`; baseline: `1` = left response.                                                                                               |
| SDT signal-present trial               | `motion_direction`, `prior`, `exp`                                | Prior conditions: prior-congruent motion; baseline: leftward motion.                                                                                                           |
| SDT signal response                    | `response_prior`                                                  | `response_prior == 1`.                                                                                                                                                         |
| DDM response/boundary                  | `response_prior`                                                  | Prior conditions: prior-congruent vs. prior-incongruent response; baseline: left vs. right response.                                                                           |
| EEG condition contrast                 | `exp`                                                             | Compare `lowlevel` vs `base` and `highlevel` vs `base`.                                                                                                                        |
| Spectral parameterization condition    | `exp`                                                             | Estimate PSD/specparam measures separately for `base`, `lowlevel`, and `highlevel`.                                                                                            |
| Psychosis proneness                    | `trait_variables.csv`: PDI/CAPS columns                           | Not in `epochs.metadata`. Compute the PDI/CAPS composite score from `pdi_*0` and `caps_*0` endorsement columns, weight by scale length, z-transform, and merge by participant. |
| High-level belief strength             | `trait_variables.csv`: `highprior_strength`                       | Not in `epochs.metadata`. VAS rating from 0-100 indexing belief in the allegedly motion-altering glasses; merge by participant.                                                |

3. Signal detection theory coding

For SDT, the manuscript defined the signal differently for baseline and prior conditions. In prior conditions, signal-present trials are trials in which physical motion is congruent with the prior. In baseline trials, leftward motion is treated as the signal.

import numpy as np
is_prior = meta_beh['exp'].isin(['lowlevel', 'highlevel'])
meta_beh['sdt_signal'] = np.where(
    is_prior,
    meta_beh['motion_direction'] == meta_beh['prior'],
    meta_beh['motion_direction'] == 'left'

)
meta_beh['sdt_signal_response'] = meta_beh['response_prior'] == 1

For each participant and condition, compute hit and false-alarm rates from sdt_signal and sdt_signal_response, then calculate criterion:

c = -0.5 * (z_hit_rate + z_false_alarm_rate)

Negative criterion values in the prior conditions indicate a bias toward the prior-congruent direction.

4. Generalized drift-diffusion modeling coding

For each participant and condition, fit a gDDM using:

| gDDM input              | Metadata source      |
| ----------------------- | -------------------- |
| Response time           | `rt`                 |
| Binary response / bound | `response_prior`     |
| Condition               | `exp`                |
| Motion coherence        | `coh` or `coh_level` |
| Trial exclusion         | `rt_flag == False`   |

In the prior conditions, the decision bounds are prior-congruent (response_prior = 1) versus prior-incongruent (response_prior = 0). In the baseline condition, the same column codes left (1) versus right (0) responses. The manuscript estimated drift rate (d), boundary separation (a), and starting point (z), with noise fixed to 1, nondecision time fixed to 200 ms, maximum RT set to 3000 ms, and drift modeled as a function of motion coherence.

5. EEG time-frequency and spectral analyses

EEG analyses are cue-locked. Use the MNE epoch time axis rather than metadata onsets for time-resolved analyses.

| EEG analysis step                  | Metadata / data source                                               |
| ---------------------------------- | -------------------------------------------------------------------- |
| Epoch anchor                       | cue onset; rows in `epochs.metadata` correspond to cue-locked epochs |
| Epoch window                       | EEG time axis, -600 to 1500 ms relative to cue onset                 |
| Baseline interval                  | EEG time axis, -600 to -100 ms                                       |
| Condition factor                   | `exp`                                                                |
| Occipital channel cluster          | O1, Oz, O2 from EEG data                                             |
| TFR contrasts                      | `lowlevel` vs `base`; `highlevel` vs `base`                          |
| TFR frequency range                | 5–40 Hz                                                              |
| Spectral-parameterization window   | 0–1500 ms relative to cue onset                                      |
| Spectral-parameterization grouping | average/fit spectra separately by `participant` and `exp`            |

Spectral parameterization outputs are not stored in epochs.metadata. They should be computed from the EEG signal and then summarized by participant and condition as aperiodic offset, aperiodic exponent, and periodic alpha power.

6. Psychosis-proneness correlations

Psychosis-proneness measures are not stored in epochs.metadata; they are derived from trait_variables.csv. To reproduce the associative analyses: 1. compute participant-level behavioral prior metrics, preferably drift rates from the gDDM, separately for lowlevel and highlevel; 2. compute PDI and CAPS endorsement sum scores from trait_variables.csv using the pdi_*0 and caps_*0 columns; 3. derive the psychosis-proneness composite by weighting the PDI and CAPS sum scores by their relative number of items and z-transforming the composite across participants; 4. merge the resulting psychosis_proneness_z score with participant-level behavioral metrics by matching trait_variables.csv:participant to epochs.metadata:participant; 5. compute product-moment correlations between psychosis proneness and low-level/high-level drift-rate metrics.

Variables not contained in epochs.metadata

The metadata table does not contain PDI scores, CAPS scores, the PDI/CAPS psychosis-proneness composite, VAS belief strength ratings, MPFI item responses, raw ICA labels, bad-channel interpolation logs, rejected-epoch annotations, SDT estimates, gDDM estimates, TFR outputs, or spectral-parameterization outputs. PDI, CAPS, MPFI, demographic, and VAS belief-strength variables are stored in trait_variables.csv; preprocessing variables must be obtained from preprocessing logs; SDT, gDDM, TFR, and spectral-parameterization variables must be obtained from analysis derivatives.

BIDS-EEG Processing Pipeline - J.Buchholz

The current data was processed with the BIDSEEG-Processing Pipeline. This pipeline enables easy-use, semi-automated processing of EEG-data from BIDSraw**up to statistical analysis, including ** preprocessing, artifact correction/rejection and conventional and **parameterized frequency analysis**. The behavioral modules further enable **generlized and hierarchical drift diffusion modelling (g/hDDM)*\*. The implemented HSSM-package enables analysis of DDM-parameter with trial-by-trial covariates (i.e. expectations, ERPs, frequency measures.) All input can be provided via a single .json file, wherefore*no extensive coding expertise is required!* The pipeline implements 4 modules: 1 Preprocessing:

  • Preprocessing BIDSified EEG data including downsampling, rereferencing, linenoise removal and filtering.

2 Artifact Correction/Rejection:
  • Data epoching, ICA (+ automatic OR manual artifactual IC deletion), bad channel interpolation (RANSAC), bad epoch deletion (autoreject).

3 EEG Analysis:
  • Computation of time-frequency representations, consecutive cluster-based permutation tests and spectral parameterization analysis (SpecParam, former FOOOF).

4 Behavioral Analysis:
  • Signal detection theory analysis and generalized drift diffusion modelling (+ predictive checks and parameter recovery study for parameter validation).

0.1 BIDSification:
  • If your data is not in BIDS-format yet, using z_BIDSification_module.py you can convert data from any output format (e.g. BrainVision) into BIDS (Brain Imaging Data Structure).

1. Conda Setup

1.1 Prerequisites

The pipeline is best executed within a conda environment. Follow the subsequent for successful setup.

Using the appropriate commands for your OS, e.g. Windows, MacOS, install conda from Miniconda Install and follow the installation guide. Testing the installation:

When the installation finishes, open your terminal application (find this by typing “terminal” into your computer’s launchpad). Test your installation by running:

conda list

If conda has been installed correctly, a list of installed packages will appear.

1.2 Install Interpreter (Visual Studio Code)

We recommend using a interpreter like Visual Studio Code or cursor. You may install VS Code from here and follow the installation guide. Pipeline input can edited via .json-file and executed via the terminal within VS Code. For Windows-Users: We recommend using open VS Code from out your Anaconda Prompt. Open your Anaconda Prompt and run:

code

that way you have access to your conda environments in the terminal within VS Code For Mac-Users: Just open VS Code from your applications. Clone the Repository After creating and activating the environment, clone the pipeline repository:

git clone https://github.com/jonathanbuc/BIDSEEG_Pipeline.git

-> Now simply open a new terminal Terminal/New Terminal and proceed with steps 1.3 and 1.4

1.3 Setup conda in Anaconda Prompt (windows) or terminal (Mac)

In your terminal, check if you are in your repository **BIDSEEG_pipeline* If not, navigate to the eeg pipeline via cd path/to/BIDSEEG_pipeline i.e., cd C:\Users\YourName\Research\EEGresearch\BIDSEEG_pipeline

1.4 Create a conda environment in your terminal (anaconda prompt = windows / terminal = Mac)

Install the provided conda environment via the .yml file. Be sure to execute the command within the EEGpipeline directory.

conda env create -f environment_setup.yml

–> Note, ‘mne-env’ is the default name of the conda environment you are creating within the EEGpipeline*directory. You can define a different name by changing*name: mne-env within the environment_setup.yml file To activate your conda environment, run:

conda activate 'mne-env'

To deactivate your conda environment, run:

conda deactivate

1.5 Explore inputs.json

–> IMPORTANT: Consult the ExperimentGuide_HierarchicalPriors.md file to gain a better understanding of the input structure. - inputs.json is the dictionary that provides values for each of the subsequent steps (preprocessing, artifact correction, analysis) - while exploring the pipeline, you may change the values in this file to see differences across different changes (i.e., change “samplingrate_down”: 250 –> 500). - please note, to use the updated inputs.json file, you must save the file to execute new commands. Save = ctl + s

2. Usage - Quick Start

The data/BIDShierPriors contains 3 subjects from Buchholz & Hesselmann (in review) - Hierarchical Priors Shape Dynamic Evidence Accumulation and Aperiodic EEG Activity as testing data for an initial run (steps 2.1-2.4). IMPORTANT: Consider the ExperimentGuide_HierarchicalPriors.md, which provides a thorough linkage of the experiment and this pipeline. We recommend using this file as guideline when proceeding with steps 2.1-2.3 This file can also be used for a replication of the respective study.

2.1 - Module 1: Preprocessing

To preprocess the BIDSified data, run:

python a_preprocessing_module.py inputs.json

2.2 - Module 2: Artifact Correction

To perform artifact correction/rejection, run:

python b_ArtifactCorrection_module.py inputs.json

2.3 - Module 4: EEG Analysis

To perform EEG analysis, run:

python c_EEGAnalysis_module.py inputs.json

2.4 - Module 4: Behavioral Analysis

To perform behavioral analysis, run:

python d_BehavAnalysis_module.py inputs.json

2.5 - Module 4: HSSM Analysis

To perform HSSM analysis, run:

python e_HSSM_module.py inputs.json
§ 03Cohort · Participants

Cohort#

Dataset Statistics#

Age distribution by gender (n=43, range 18–40 yr, mean 24.9 yr)

1520253040
Female · 27Male · 15Other · 1

Sex composition

43
subjects
Female
27
Male
15
Other
1
F : M ratio
1.80 : 1
63% female · n = 43 subjects with reported sex.
HandednessRight · 36Left · 5

Channel counts: 31 ch (n=43 recordings)

Sampling frequencies: 1000.0 Hz (n=43 recordings)

Total recording duration: 42 h

§ 04Signal · Electrodes & trace

Signal · Electrodes & live trace#

Fig. 01 Signal & montage 31 ch · EEG · 1000 Hz · 43 subjects, 43 recordings
Live trace viewer — sub-037 · ses-01 · task-HierPrior

Showing one representative recording out of 43 subjects and 43 recordings in this dataset. Browse the full set on OpenNeuro; drop any other _eeg.{set,edf,bdf,vhdr} file onto the viewer (or pass ?eeg=<url>) to inspect it.

Electrode layout — EEG · 31 sensors — 31 channels

NEMAR Processing Statistics#

The plots below are generated by NEMAR’s automated EEG pipeline. The histogram shows pipeline success for data cleaning and ICA decomposition, the percentage of data frames and EEG channels retained after artefact removal, line noise per channel (RMS, dB), and the age/gender distribution of participants.

HED event descriptors word cloud HED event descriptors word cloud — ON008083
§ 05Manifest · BIDS tree

Manifest#

File Explorer#

Browse the BIDS file structure of this dataset. Records are fetched on demand from the EEGDash catalog the first time you open the explorer.

Recordings
Files
Subjects
Modalities
Click to load file structure…
Full dataset metadata table

Dataset ID

ON008083

Title

Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors

Author (year)

Canonical

Importable as

ON008083

Year

2023

Authors

Jonathan Buchholz, Guido Hesselmann

License

CC0

Citation / DOI

10.82901/nemar.on008083

Source links

OpenNeuro | NeMAR | Source URL

Copy-paste BibTeX
@dataset{on008083,
  title = {Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors},
  author = {Jonathan Buchholz and Guido Hesselmann},
  doi = {10.82901/nemar.on008083},
  url = {https://doi.org/10.82901/nemar.on008083},
}
§ 06API · Programmatic access

API Reference#

Signature
eegdash.dataset
class
eegdash.dataset.ON008083(cache_dir, query=None, s3_bucket=None, **kwargs)
Bases: EEGDashDataset
Author (year)
Canonical
Importable asON008083
Sourceeegdash/dataset/registry.py · [source ↗]
class eegdash.dataset.ON008083(cache_dir: str, query: dict | None = None, s3_bucket: str | None = None, **kwargs)[source]#

Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors

Study:

on008083 (NeMAR)

Author (year):

Canonical:

Also importable as: ON008083.

Modality: eeg; Subject type: Unknown. Subjects: 43; recordings: 43; tasks: 1.

Parameters:
  • cache_dir (str | Path) – Directory where data are cached locally.

  • query (dict | None) – Additional MongoDB-style filters to AND with the dataset selection. Must not contain the key dataset.

  • s3_bucket (str | None) – Base S3 bucket used to locate the data.

  • **kwargs (dict) – Additional keyword arguments forwarded to EEGDashDataset.

data_dir#

Local dataset cache directory (cache_dir / dataset_id).

Type:

Path

query#

Merged query with the dataset filter applied.

Type:

dict

records#

Metadata records used to build the dataset, if pre-fetched.

Type:

list[dict] | None

Notes

Each item is a recording; recording-level metadata are available via dataset.description. query supports MongoDB-style filters on fields in ALLOWED_QUERY_FIELDS and is combined with the dataset filter. Dataset-specific caveats are not provided in the summary metadata.

References

OpenNeuro dataset: https://openneuro.org/datasets/on008083 NeMAR dataset: https://nemar.org/dataexplorer/detail?dataset_id=on008083 DOI: https://doi.org/10.82901/nemar.on008083

Examples

>>> from eegdash.dataset import ON008083
>>> dataset = ON008083(cache_dir="./data")
>>> recording = dataset[0]
>>> raw = recording.load()
__init__(cache_dir: str, query: dict | None = None, s3_bucket: str | None = None, **kwargs)[source]#
save(path: str, overwrite: bool = False, offset: int = 0)[source]#

Save datasets to files by creating one subdirectory for each dataset:

path/
    0/
        0-raw.fif | 0-epo.fif
        description.json
        raw_preproc_kwargs.json (if raws were preprocessed)
        window_kwargs.json (if this is a windowed dataset)
        window_preproc_kwargs.json  (if windows were preprocessed)
        target_name.json (if target_name is not None and dataset is raw)
    1/
        1-raw.fif | 1-epo.fif
        description.json
        raw_preproc_kwargs.json (if raws were preprocessed)
        window_kwargs.json (if this is a windowed dataset)
        window_preproc_kwargs.json  (if windows were preprocessed)
        target_name.json (if target_name is not None and dataset is raw)
Parameters:
  • path (str) –

    Directory in which subdirectories are created to store

    -raw.fif | -epo.fif and .json files to.

  • overwrite (bool) – Whether to delete old subdirectories that will be saved to in this call.

  • offset (int) – If provided, the integer is added to the id of the dataset in the concat. This is useful in the setting of very large datasets, where one dataset has to be processed and saved at a time to account for its original position.

Access modesMNE → braindecode → PyTorch → ML
.rawMNE Raw object — standard tools (filter, epoch, ICA, plot_psd).mne
DataLoaderWraps the windowed dataset into a PyTorch DataLoader; supports parallel workers and on-the-fly augmentations.pytorch
Zarr cacheOptional braindecode Zarr mirror for fast resume; persisted to cache_dir.zarr
Hugging FaceNo per-dataset mirror published yet — browse the EEGDash org listing for sibling datasets. See the datasets loader API.huggingface
Croissant 1.0Machine-readable JSON-LD descriptorON008083.croissant.json (MLCommons schema, ingestible by PyTorch / TensorFlow / JAX).mlcommons
Examples using EEGDashcurated · start here

Swap any load_dataset(...) call for on008083 to reproduce the tutorial on this dataset.

Citation

Jonathan Buchholz, Guido Hesselmann (2023). Hierarchical Priors in Perceptual Uncertainty and Psychosis Proneness - A Random-Dot Kinematogram task with low- and high-level priors. 10.82901/nemar.on008083

Provenance

¹Contributed to nemar in BIDS format.

²Curated & ingested by the EEGDash catalog; see CITATION.cff for canonical reference.

³Persistent identifier: 10.82901/nemar.on008083.

BIDS
BIDS 1.9.0
Sidecars
events · events.json · channels · eeg.json
Provenance
Machine-readable
Mirrors

See Also#