Code
import os
import matplotlib.pyplot as plt
import warnings
from jaxcmr.analyses.conditional_crp import plot_crp
from jaxcmr.helpers import find_project_root, generate_trial_mask, load_data, save_figure
warnings.filterwarnings("ignore")Compute Lag-CRP while selectively excluding transitions via a tabulation mask.
The conditional Lag-CRP extends the standard Lag-CRP by adding a _should_tabulate mask that controls which transitions are counted. When the mask is False for a recall event, the tabulator still updates internal state (availability, previous positions) but does not increment lag tallies. This is useful for excluding specific transitions (e.g., intrusions) while preserving correct availability tracking.
Axes and patterns are identical to the standard Lag-CRP, but transitions where the mask is False are excluded from tallies.
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.The _should_tabulate mask is constructed in the load cell as data["recalls"] > 0 (excludes intrusions). Modify this expression to change which transitions are excluded.