Skip to content

Session reliability metrics for cue and lever epochs #173

Description

@celefthe

Add trial-to-trial reliability metrics to the _metrics-session.csv written by process metrics, for go/no-go sessions only.

Epochs

  • Cue-aligned (cue_onset, trial_start): each trial is masked from its response time on. Miss and correct-rejection trials end at the median RT of all responding trials. --no-mask-response turns masking off.
  • Lever-aligned (response): the epoch runs from the cue to the lever push, end exclusive, so the movement and reward are left out. Needs process peri-event --event response aligns to start_time + response_time instead of cue_onset + response_time #176.
  • Trials with RT < 200 ms are dropped (--min-rt).
  • Lever-aligned baseline is taken before each trial's cue. Trials whose pre-cue baseline falls outside the window get NaN, and the count is reported. Lever-aligned runs need a longer --pre.

Metrics (new columns; existing columns unchanged)

  • epoch_correlation: zero-lag mean pairwise Pearson r over the masked epoch, using the samples each pair shares. --time-warp resamples each epoch onto a common 0–1 grid instead.
  • response_fraction: fraction of trials whose mean epoch ∆F exceeds baseline by --response-sd (default 2) baseline SDs.
  • variance_quench: across-trial variance over the epoch divided by across-trial variance over the baseline.
  • signal_fraction: fraction of single-trial variance explained by the trial mean.
  • reliability_n: trials used after exclusions.

Groups (wide format, still one row per region)

  • <metric> covers all trials.
  • <metric>_sdt-<hit|miss|false_alarm|correct_rejection> gives one column per trial type.
  • <metric>_stim-<go|nogo> gives one column per stimulus type.
  • Every group column is always written. A group gets NaN when it has fewer than 10 trials or no trials.
  • If a peri-event CSV lacks sdt_type or response_time, the new columns are skipped with a warning.

The peri-event report's session table shows the new columns, with a group selector. Documented in docs/how-to/metrics.md.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestprocessingWhat we do with the delta Fs

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions