<figure>
<img src="./images/dd-thumbnail.png"
width="500px">
<figcaption>Overview of the delay discounting task.</figcaption>
</figure>


## 1. Initialization¶

• Design variables

• t_ss ($$t_{SS}$$): Delay for the SS (smaller, sooner) option

• t_ll ($$t_{LL}$$): Delay for the LL (larger, later) option

• The delay on SS option should be sooner than that of LL option ($$t_{SS} < t_{LL}$$).

• r_ss ($$R_{SS}$$): Reward value for the SS (smaller, sooner) option

• r_ll ($$R_{LL}$$): Reward value for the LL (larger, later) option

• The reward on SS option should be smaller than that of LL option ($$R_{SS} < R_{LL}$$).

• Possible responses:

• choice: 0 (SS option), 1 (LL option)

[1]:

from adopy.tasks.dd import TaskDD


[2]:

task.name

[2]:

'Delay discounting task'

[3]:

task.designs

[3]:

['t_ss', 't_ll', 'r_ss', 'r_ll']

[4]:

task.responses

[4]:

['choice']


### 2) Model: Hyperbolic model (Mazur, 1987)¶

\begin{split}\begin{aligned} \text{discounting factor} \; D(t) &= \frac{1}{1 + kt} \\ V_{SS} &= R_{SS} \cdot D(t_{SS}) \\ V_{LL} &= R_{LL} \cdot D(t_{LL}) \\ P(LL \, over \, SS) &= \frac{1}{1 + \exp [- \tau \cdot \gamma (V_{LL} - V_{SS})]} \end{aligned}\end{split}
• Model parameters

• k ($$k$$): discounting rate parameter

• tau ($$\tau$$): inverse temperature

[5]:

from adopy.tasks.dd import ModelHyp

model = ModelHyp()

[6]:

model.name

[6]:

'Hyperbolic model for the DD task'

[7]:

model.params

[7]:

['k', 'tau']


### 3) Grid definition¶

#### Grid for design variables¶

[8]:

import numpy as np

grid_design = {
# [Now]
't_ss': [0],
# [3 days, 5 days, 1 week, 2 weeks, 3 weeks,
#  1 month, 6 weeks, 2 months, 10 weeks, 3 months,
#  4 months, 5 months, 6 months, 1 year, 2 years,
#  3 years, 5 years, 10 years] in a weekly unit
't_ll': [0.43, 0.714, 1, 2, 3,
4.3, 6.44, 8.6, 10.8, 12.9,
17.2, 21.5, 26, 52, 104,
156, 260, 520],
# [$12.5,$25, ..., $775,$787.5]
'r_ss': np.arange(12.5, 800, 12.5),