# Data and code for "Probabilistic models of delay discounting: improving plausibility and performance"
## Data
Raw decision data is in "data.csv". The columns are as follows:
- `id`: Participant identifier
- `v_s`: Value of smaller (immediate) reward
- `v_l`: Value of larger (delayed) reward
- `R`: Relative value of immediate reward, i.e. `v_s`/`v_l`
- `D`: Delay of delayed reward in days
- `c`: Choice; `"I"` for immediate reward, `"D"` for delayed reward
## Code
"linear-model-fitting.R" fits the generalized linear models and stores the results in "linear-model-results.csv". "linear-model-comparison.R" then produces the table of comparisons between D- and D+ models.
Similarly, "nonlinear-model-fitting.R" fits nonlinear models. Depending on the value of the variable `case` (`1` or `2`), this script writes "nonlinear-model-results-1.csv" or "nonlinear-model-results-2.csv". For case 1, the γ (gamma) parameter is scaled linearly by `v_l` for D- models but it not scaled for D+ models. For case 2, γ is scaled by the ς ("varsigma") function for both D- and D+ models. "nonlinear-model-comparison.R" reads one of the results files and produces the comparisons between D- and D+ models.