This repository contains the data and analysis scripts for model recovery in intertemporal choice.
Intertemporal choice refers to decisions involving tradeoffs between costs and benefits occurring at different points in time, such as choosing between a smaller reward available immediately and a larger reward available after a delay.
The primary goal of this project is to validate the model selection procedure and assess the reliability of the best-fitting intertemporal choice model. This is achieveed through a model recovery analysis, which involves:
- Model comparison to identify the best-fitting model for explaining empirical choices.
- Simulation of experimental procedures using agents based on the best-fitting model.
- Model recovery analysis to determine if the best-fitting model and its true parameters can be accurately recovered from simulated data.
This approach allows us to:
- Verify the validity of our model selection procedure
- Assess the identifiability of the best-fitting model
- Evaluate the accuracy of parameter estimates
- Understand potential limitations in inferring decision processes from choice data
No installation is required beyond having R and the necessary libraries. To run the script, simply clone this repository or download the script files and execute them within your R environment.
Clone this repository:
git clone https://github.com/username/intertemporal-choice-recovery.git
Navigate to the project directory:
cd path/to/intertemporal-choice-recovery
Refer to the header of recover_model.R
script for a complete list of necessary libraries.
Set the working directory to the project folder in your R environment:
setwd("path/to/intertemporal-choice-recovery")
Run the main analysis script recover_model.R
.
The project's key components are organized as follows:
- Model functions:
R/models/
Contains implementations of the intertemporal choice models. - Helper functions:
R/tools/
Includes utility functions for data preprocessing, model fitting, and result visualization. - Data:
data/
Stores the empirical data used in the analysis. - Output:
output/
Contains generated results and visualizations. - Checkpoints:
checkpoints/
Stores intermediate results for efficient analysis resumption.
Six intertemporal choice models are evaluated, implemented in R/models/
:
Discounting models (with power choice rule):
- Exponential discounting model (EXPO)
- Hyperboloid model (HYPER2)
- Dual-Exponential model (DEXPO)
Heuristic models (with exponential choice rule):
- Intertemporal Choice Heuristic (ITCH)
- Difference-Ratio-Interest-Finance-Time model (DRIFT)
- Trade-off model (TRADE)
Model definitions are based on:
Wulff, D. U., & van den Bos, W. (2018). Modeling Choices in Delay Discounting. Psychological Science, 29(11). https://doi.org/10.1177/0956797616664342
The empirical data used for initial model comparison is stored in data/
and is from:
Marzilli Ericson, K. M., White, J. M., Laibson, D., & Cohen, J. D. (2015). Money Earlier or Later? Simple Heuristics Explain Intertemporal Choices Better Than Delay Discounting Does. Psychological Science, 26(6), 826โ833. https://doi.org/10.1177/0956797615572232
The data was collected in an experiment that presents participants with a series of binary choices between smaller-sooner and larger-later monetary rewards, varying the amounts and time delays to assess individual intertemporal preferences.
The analysis uses checkpoints to save intermediate results in checkpoints/
:
- Cross-validation results: "checkpoints/cross_validation.rds"
- Agent parameters: "checkpoints/agent_parameters.rds"
- Simulations: "checkpoints/simulations.rds"
- Recovered parameters: "checkpoints/recovered_parameters.rds"
These checkpoints allow for efficient resumption of the analysis if interrupted. To re-run specific sections of the analysis, simply delete the corresponding checkpoint files in checkpoints/
.
- Model comparison using Monte Carlo Cross-Validation (MCCV) to identify the best-fitting model
- Parameter estimation for the best-fitting model
- Simulation of choices using agents based on the best-fitting model and estimated parameters
- Model recovery analysis on simulated data:
- Recover the best-fitting model
- Estimate parameters and compare to true values
- Bland-Altman analysis for assessing agreement between true and recovered parameters
- Statistical inference using permutation tests
- Visualization of results
Please note that the modeling procedure, particularly cross-validation, require relatively large computational power and may take some time.
The analysis generates several outputs:
- Visualization of model errors (
output/model_error.png
) - Parameter recovery plots, including Bland-Altman plots (
output/parameter_recovery.png
) - Combined figure for model evaluation and recovery (
output/figure.png
)
These results provide insights into the reliability of the model selection procedure, the identifiability of the best-fitting intertemporal choice model, and the accuracy of parameter recovery.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or feedback, please contact the author directly.