adopy.tasks.cra
¶
The choice under risk and ambiguity task (CRA; Levy et al., 2010) involves preferential choice decisions in which the participant is asked to indicated his/her preference between two options:
A fixed (or reference) option of either winning a fixed amount of reward (\(R_F\),
r_fix
) with a fixed probability of 0.5 or winning none otherwise; andA variable option of either winning a varying amount of reward (\(R_V\),
r_var
) with a varying probability (\(p_V\),p_var
) and a varying level of ambiguity (\(A_V\),a_var
) or winning none otherwise.
Further, the variable option comes in two types:
risky type in which the winning probabilities are fully known to the participant; and
ambiguous type in which the winning probabilities are only partially known to the participant.
The level of ambiguity (\(A_V\)) is varied between 0 (no ambiguity and thus fully known) and 1 (total ambiguity and thus fully unknown).
References
Levy, I., Snell, J., Nelson, A. J., Rustichini, A., & Glimcher, P. W. (2010). Neural Representation of Subjective Value Under Risk and Ambiguity. Journal of Neurophysiology, 103 (2), 1036-1047.
Task¶
-
class
adopy.tasks.cra.
TaskCRA
¶ Bases:
adopy.base._task.Task
The Task class for the choice under risk and ambiguity task (Levy et al., 2010).
- Design variables
p_var
(\(p_V\)) - probability to win of a variable optiona_var
(\(A_V\)) - level of ambiguity of a variable optionr_var
(\(R_V\)) - amount of reward of a variable optionr_fix
(\(R_F\)) - amount of reward of a fixed option
- Responses
0 (choosing a fixed option) or 1 (choosing a variable option)
Examples
>>> from adopy.tasks.cra import TaskCRA >>> task = TaskCRA() >>> task.designs ['p_var', 'a_var', 'r_var', 'r_fix'] >>> task.responses [0, 1]
A task object stores information for a specific experimental task, including labels of design variables (
designs
), possible responses (responses
) and its name (name
).- Parameters
designs – Labels of design variables in the task.
responses – Possible values for the response variable of the task.
name – Name of the task.
Examples
>>> task = Task(name='Task A', designs=['d1', 'd2'], responses=[0, 1]) >>> task Task('Task A', designs=['d1', 'd2'], responses=[0, 1]) >>> task.name 'Task A' >>> task.designs ['d1', 'd2'] >>> task.responses [0, 1]
Model¶
-
class
adopy.tasks.cra.
ModelLinear
¶ Bases:
adopy.base._model.Model
The linear model for the CRA task (Levy et al., 2010).
\[\begin{split}\begin{align} U_F &= 0.5 \cdot (R_F)^\alpha \\ U_V &= \left[ p_V - \beta \cdot \frac{A_V}{2} \right] \cdot (R_V)^\alpha \\ P(V\, over \, F) &= \frac{1}{1 + \exp [-\gamma (U_V - U_F)]} \end{align}\end{split}\]- Model parameters
alpha
(\(\alpha\)) - risk attitude parameter (\(\alpha > 0\))beta
(\(\beta\)) - ambiguity attitude parametergamma
(\(\gamma\)) - inverse temperature (\(\gamma > 0\))
References
Levy, I., Snell, J., Nelson, A. J., Rustichini, A., & Glimcher, P. W. (2010). Neural Representation of Subjective Value Under Risk and Ambiguity. Journal of Neurophysiology, 103 (2), 1036-1047.
Examples
>>> from adopy.tasks.cra import ModelExp >>> model = ModelExp() >>> model.task Task('CRA', designs=['p_var', 'a_var', 'r_var', 'r_fix'], responses=[0, 1]) >>> model.params ['alpha', 'beta', 'gamma']
-
compute
(p_var, a_var, r_var, r_fix, alpha, beta, gamma)¶ Compute the probability of choosing a certain response given values of design variables and model parameters.
-
class
adopy.tasks.cra.
ModelExp
¶ Bases:
adopy.base._model.Model
The exponential model for the CRA task (Hsu et al., 2005).
\[\begin{split}\begin{align} U_F &= 0.5 \cdot (R_F)^\alpha \\ U_V &= (p_V) ^ {(1 + \beta \cdot A_V)} \cdot (R_V)^\alpha \\ P(V\, over \, F) &= \frac{1}{1 + \exp [-\gamma (U_V - U_F)]} \end{align}\end{split}\]- Model parameters
alpha
(\(\alpha\)) - risk attitude parameter (\(\alpha > 0\))beta
(\(\beta\)) - ambiguity attitude parametergamma
(\(\gamma\)) - inverse temperature (\(\gamma > 0\))
References
Hsu, Y.-F., Falmagne, J.-C., and Regenwetter, M. (2005). The tuning in-and-out model: a randomwalk and its application to presidential election surveys. Journal of Mathematical Psychology, 49, 276–289.
Examples
>>> from adopy.tasks.cra import ModelLinear >>> model = ModelLinear() >>> model.task Task('CRA', designs=['p_var', 'a_var', 'r_var', 'r_fix'], responses=[0, 1]) >>> model.params ['alpha', 'beta', 'gamma']
-
compute
(p_var, a_var, r_var, r_fix, alpha, beta, gamma)¶ Compute the probability of choosing a certain response given values of design variables and model parameters.