Skip to content

Raw Data and Scripts for the Article "Prediction Error and Episodic Memory"

Notifications You must be signed in to change notification settings

FPupillo/PreM-Computational

Repository files navigation

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.

Learning Performance

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.

Computational Models

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.

Model-derived PE and memory

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

Scripts related to analysis and modeling of the data

analysis_files

Files used to compute descriptive and inferential analyses on the data

01.cumAccByScene_learnVsEnc.R

Scripts that calculates the cumulative accuracy by scene.

02.ModelFree_analyses_agg.R

Analyses of participants' performance without computationally-derived values.

03.analysis_model-derivedPE_memory.Rmd

Analyses of the computatinally-derived PE

S.01.analysis_signed_model-derivedPE_memory.Rmd

Supplementary analysis of the signed model_derivedPE on memory.

S.CI.Rdata

Data object containing the bootstrapped Confidence Intervals for the regression coefficient of the main model.

figures

Plots created by the different scripts.

fitting_functions

Functions used to fit the different computational models.

fitting_scripts

Scripts that fit the computational models to participants' data.

helper_functions

Custom functions that are used by the other scripts.

likelihood_functions

Functions that compute the likelihood for the different computational models.

output_files

Files created by the different scripts.

parameter_estimation

Scripts that estimate the single subjects' parameters.

parameter_recovery

Scripts used to assess parameters' recoverability and print diagnostic plots.

simulation_functions

Scripts that simulate the data. They are used for both parameter and model recovery.

Table S1

Supplementary table S1

01.runParameterRecovery.sh

Bash script which performs parameter recovery

02.runModel.R

Script that performs model recovery.

03.plotConfusionMatrix.R

Scripts that plots the confusion matrix to check model recovery.

04.runParameterEstimation.sh

Bash script file that runs the parameter estimation for the different computational model.

05.modelComparison_comparefit.R

Scripts that compare the fit of the different models and outputs the results.

06.fitModels.sh

Fitting the best-fitting models to participants' data to estimate PE.

07.compare_simulatedvsempirical.R

Validating the models by comparing syntetic behavioural data generated by the models and actual participants' data.

08.MasterScript.sh

File that runs all the previous steps sequentially.

codebook.md

Description of the variables contained in the raw data.

exp1

Raw data and computationally-derived data for Experiment 1.

exp2

Raw data and computationally-derived data for Experiment 2.

PREMUP_computational.Rproj

R project file, to control working directory, history, source files, etc.

About

Raw Data and Scripts for the Article "Prediction Error and Episodic Memory"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages