cardioception.PAT.scoring.consistency_grid#

cardioception.PAT.scoring.consistency_grid(final_df, n_sim=100000, q=0.95, seed=0, k=5.0)[source]#

Score one participant on the 2 x 2 x 2 grid of Hodgetts et al. (2026).

Parameters
final_dfpd.DataFrame

The task’s final.txt. Columns used: Block (only "main" rows count), ChosenDelayMs, AnticipatedPeriodMs, ObservedPeriodMs, Confidence and, when present, TrialStatus (only "ok" rows count; an empty status counts as "ok").

n_sim, q, seed

Passed to monte_carlo_threshold(). With an int seed (the default) the thresholds are reproducible.

kfloat

Outlier cut-off for the periods, in robust standard deviations.

Returns
gridpd.DataFrame

Eight rows with the columns mapping (variable/fixed), period (anticipated/observed), weighting (none/confidence), n_trials (trials scored), n_dropped (main trials left out because their TrialStatus is not ok, the same on every row), score (MRL), threshold and interoceptive (score above threshold). A cell with no usable trial (no observed periods, or no confidence ratings for the weighted cells) has NaN score and threshold and is not interoceptive.

Notes

Main trials whose status is not ok are dropped first. Then, per period type, trials with a missing delay or period are dropped, then trials whose period is a mad_outliers() outlier. Fixed mapping uses the median of the remaining periods for every trial and drops trials whose delay exceeds it. Weighted cells drop trials without a confidence rating.