Conditional Co-Recall by Lag

Measure how nearby study positions cluster in recall, conditioned on anchor recall.

Conditional co-recall by lag measures the probability that a neighbor \(d\) positions away in the study list was recalled, given that the anchor position was recalled, ignoring recall order. For each recalled anchor at position \(i\), we check whether the item at position \(i + d\) was also recalled on the same trial.

\[\text{CoRec}(d) = \frac{\sum_t \text{co-recalled pairs at lag } d}{\sum_t \text{recalled anchors available at lag } d}\]

Unlike joint co-recall, conditioning on the anchor being recalled removes the baseline recall rate, isolating the associative clustering between nearby study positions.

Workflow

Code
import os
import matplotlib.pyplot as plt
import warnings
from jaxcmr.analyses.conditional_corec_by_lag import plot_conditional_corec_by_lag
from jaxcmr.helpers import find_project_root, generate_trial_mask, load_data, save_figure

warnings.filterwarnings("ignore")
Code
data_path = "data/HealeyKahana2014.h5"
figure_dir = "results/figures"
figure_str = ""
ylim = None
trial_query = "data['listtype'] == -1"
max_lag = None
confidence_level = 0.95
Code
project_root = find_project_root()
figure_dir = os.path.join(project_root, figure_dir)
data_path = os.path.join(project_root, data_path)
data = load_data(data_path)
trial_mask = generate_trial_mask(data, trial_query)
Code
plot_conditional_corec_by_lag(datasets=data, trial_masks=trial_mask, max_lag=max_lag, confidence_level=confidence_level)
if ylim is not None:
    for ax in plt.gcf().axes:
        ax.set_ylim(ylim)
save_figure(figure_dir, figure_str)

Interpretation

The x-axis shows study lag and the y-axis shows the conditional probability that the neighbor was also recalled. Key patterns:

  • Peak near lag 1: items studied immediately after the anchor are most likely to be co-recalled, reflecting associative clustering.
  • Decline with lag: co-recall probability drops with increasing study distance.
  • Comparison with joint co-recall: conditional co-recall removes baseline recall rate, providing a cleaner measure of associative strength.

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 tuple, or None for automatic scaling.- trial_query — a Python expression evaluated against the dataset to select trials.- max_lag — maximum lag to display, or None to use all available lags.- confidence_level — confidence level for subject-wise error bars.To compare across datasets, re-run with different data_path and trial_query values. For example, LohnasKahana2014.h5 uses trial_query = "data['list_type'] == 1" while HealeyKahana2014.h5 uses trial_query = "data['listtype'] == -1".