Separate temporal contiguity curves by presentation index for repeated items.
The repetition Lag-CRP extends the standard Lag-CRP analysis to study lists containing repeated items. For each recall of a repeated item, the analysis separately tabulates lag transitions relative to each of the item’s study positions. This produces one CRP curve per presentation index, revealing whether transitions from repeated items cluster around the first or second occurrence.
Comparing repetition CRP curves between observed data and shuffled controls helps isolate repetition-specific effects from baseline temporal contiguity.
/Users/jordangunn/workspace/.venv/lib/python3.12/site-packages/scipy/_lib/_util.py:440: DegenerateDataWarning: The BCa confidence interval cannot be calculated. This problem is known to occur when the distribution is degenerate or the statistic is np.min.
return fun(*args, **kwargs)
/Users/jordangunn/workspace/jaxcmr/jaxcmr/analyses/repcrp.py:592: SmallSampleWarning: After omitting NaNs, one or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
t_stat, t_pval = stats.ttest_rel(obs_col, ctrl_col, nan_policy="omit")
/Users/jordangunn/workspace/jaxcmr/jaxcmr/analyses/repcrp.py:603: RuntimeWarning: Mean of empty slice
mean_diffs[lag_idx] = np.nanmean(diff)
/Users/jordangunn/workspace/jaxcmr/jaxcmr/analyses/repcrp.py:660: SmallSampleWarning: After omitting NaNs, one or more sample arguments is too small; all returned values will be NaN. See documentation for sample size requirements.
t_stat, t_pval = stats.ttest_rel(obs_d, ctrl_d, nan_policy="omit")
/Users/jordangunn/workspace/jaxcmr/jaxcmr/analyses/repcrp.py:671: RuntimeWarning: Mean of empty slice
mean_diffs[lag_idx] = np.nanmean(diff_of_diff)
Interpretation
Two plots are produced: one for observed (mixed-list) data and one for the shuffled control. Each plot shows separate CRP curves for transitions relative to the first and second presentation of repeated items. Key patterns:
First vs. second presentation bias: if one presentation’s curve is consistently higher, participants preferentially transition relative to that occurrence.
Observed vs. control: differences between observed and control curves isolate repetition-specific contiguity beyond what shuffled position assignments would produce.
Statistical tests: the t-tests and Wilcoxon tests quantify whether the observed repetition CRP reliably exceeds the control at each lag.
API Details
Notebook parameters
data_path — path to an HDF5 file containing a RecallDataset.
figure_dir — directory for saving figures.
figure_str — base filename for the saved figure. Leave empty to display without saving.
ylim — y-axis limits as a list, or None for automatic scaling.
mixed_trial_query — query selecting trials with repeated items.
control_trial_query — query selecting trials for the control (typically non-repeating lists).
control_shuffles — number of shuffle iterations for building the control dataset.
min_lag — minimum absolute lag included in the analysis.
max_lag — maximum absolute lag displayed.
size — maximum number of study positions a single item can occupy.
confidence_level — confidence level for subject-wise error bars.