Files and analysis scripts reported in the paper "The Effect of Prediction Error on Episodic Memory Encoding is modulated by the Outcome of the Predictions".
The scripts contained in this repository are written in bash and R languages. Version used: R version 4.2.1 (2022-06-23). R is a free software that can be downloaded here. The scripts written in bash are used to manage several R scripts at once.
The visualization and analysis of learning performance for the practice and encoding tasks are carried out in the script scripts/analysis_files/01.cumAccByScene_learnVsEnc.R
.
Parameter Recovery is carried out by the bash script scripts/01.runParameterRecovery.sh
. The scripts used are in the folder scripts/parameter_recovery
.
There are four different files which perform recovery for the four different models considered in the paper.
These scripts use the simulation, likelihood, and fitting functions contained in the folders scripts/simulation_functions
, scripts/likelihood_functions
, and scripts/fitting_functions
, respectively.
Model Recovery is performed by the scripts/02.runModelRecover.R
script.
The script scripts/03.plotConfusionMatrix.R
plots the confusion matrix after the model recovery process has been run.
Model comparison is performed by the script scripts/05.modelComparison_comparefit.R
.
The script scripts/06.fitModels.sh
fits the models and extract computationally-derived quantities.
The script scripts/07.compare_simulatedvsempirical.R
compare the simulated data with the empirical data.
The file scripts/analysis_files/02_ModelFree_analyses.R
contains the scripts for visualizing and analyzing the data as a function of the condition of the predicted category. These analyses are included in the Supplementary Material.
The file scripts/analysis_files/03.analysis_model-derivedPE_memory.Rmd
contains the code used to run the analysis reported in the article.
The file scripts/analysis_files/S.01.analysis_signed_model-derivedPE_memory.Rmd
contains the code used to run analysis of the effects of signed PE on episodic memory.
Description of all the folders and files:
Scripts related to analysis and modeling of the data
Files used to compute descriptive and inferential analyses on the data
Scripts that calculates the cumulative accuracy by scene.
Analyses of participants' performance without computationally-derived values.
Analyses of the computatinally-derived PE
Supplementary analysis of the signed model_derivedPE on memory.
Data object containing the bootstrapped Confidence Intervals for the regression coefficient of the main model.
Plots created by the different scripts.
Functions used to fit the different computational models.
Scripts that fit the computational models to participants' data.
Custom functions that are used by the other scripts.
Functions that compute the likelihood for the different computational models.
Files created by the different scripts.
Scripts that estimate the single subjects' parameters.
Scripts used to assess parameters' recoverability and print diagnostic plots.
Scripts that simulate the data. They are used for both parameter and model recovery.
Supplementary table S1
Bash script which performs parameter recovery
Script that performs model recovery.
Scripts that plots the confusion matrix to check model recovery.
Bash script file that runs the parameter estimation for the different computational model.
Scripts that compare the fit of the different models and outputs the results.
Fitting the best-fitting models to participants' data to estimate PE.
Validating the models by comparing syntetic behavioural data generated by the models and actual participants' data.
File that runs all the previous steps sequentially.
Description of the variables contained in the raw data.
Raw data and computationally-derived data for Experiment 1.
Raw data and computationally-derived data for Experiment 2.
R project file, to control working directory, history, source files, etc.