ProspectUtility#
- class ProspectUtility(magnitudes=None, probabilities=None, alpha=1, beta=None, lambda_loss=1, gamma=1, delta=1, utility_curve=None, weighting='tk', **kwargs)[source]#
Bases:
objectA class for computing choice utilities based on prospect theory.
- Parameters:
- magnitudesnumpy.ndarray
A nested array where the outer dimension represents trials, with each trial containing the potential outcome magnitudes for each option.
- probabilitiesnumpy.ndarray
A nested array (with the same shape as magnitudes) where each entry contains the probability of the corresponding outcome.
- alpha
float The utility curvature parameter, used for both gains and losses.
- beta
float, optional An optional parameter for the utility function used by Tversky and Kahneman (1992) for losses, defaults to
alphaif not provided.- lambda_loss
float The loss aversion parameter (scaling losses relative to gains).
- gamma
float The probability weighting curvature parameter (for gains with “tk” and both gains and losses with “power”).
- delta
float, optional The attractiveness parameter, which determines the elevation of the weighting function in
prelecandgwweighting functions. Intk, it is the probability weighting for losses. Defaults togammaif not provided.- utility_curve
callable(), optional An optional utility function that takes the magnitude, alpha, and lambda_loss, and returns the utilities of each choice options. The default is a power utility function, see Notes.
- weighting
str The definition of the weighting function. Should be one of ‘tk’, ‘pd’, or ‘gw’. See Notes for details.
- **kwargs
dict, optional Additional keyword arguments.
Notes
The different weighting functions currently implemented are:
tk: Tversky & Kahneman (1992).prelec: Prelec (1998).gw: Gonzalez & Wu (1999).power: Simple power function: w(p) = p^gamma
Following Tversky & Kahneman (1992), the expected utility U of a choice option is defined as:
\[\mathcal{U} = \sum_{i=1}^{n} w(p_i) \cdot u(x_i)\]where \(w\) is a weighting function of the probability p of a potential outcome, and \(u\) is the utility function of the magnitude x of a potential outcome. The utility function \(u\) is defined as a power function for both gains and losses. It is implemented after Equation 5 in Tversky & Kahneman (1992):
\[\begin{split}u(x) = \begin{cases} x^\alpha & \text{if } x \geq 0 \\ -\lambda \cdot (-x)^\alpha & \text{if } x < 0 \end{cases}\end{split}\]where \(\alpha\) is the utility curvature parameter, and \(\lambda\) is the loss aversion parameter. The weighting function is implemented after Equation 6 in Tversky & Kahneman (1992):
\[w(p) = \frac{p^\gamma}{(p^\gamma + (1 - p)^\gamma)^{1/\gamma}}\]where
gamma, denoted via \(\gamma\), is the discriminability parameter of the weighting function. In the original formulation of Tversky & Kahneman (1992), losses are weighted with a different parameter,delta, denoted via \(\delta\), that replaces \(\gamma\) in the weighting function for losses. In the current implementation, whether it is a gain or less is determined by the sign of the corresponding magnitude.Several other definitions of the weighting function have been proposed in the literature, most notably in Prelec (1998) and Gonzalez & Wu (1999). Prelec (equation 3.2, 1998, pp. 503) proposed the following definition:
\[w(p) = \exp(-\delta \cdot (-\log(p))^\gamma)\]where
delta, \(\delta\), andgamma, \(\gamma\), are the attractiveness and discriminability parameters of the weighting function. Gonzalez & Wu (equation 3, 1999, pp. 139) proposed the following definition:\[w(p) = \frac{\delta \cdot p^\gamma}{\delta \cdot p^\gamma + (1 - p)^\gamma}\]References
Gonzalez, R., & Wu, G. (1999). On the shape of the probability weighting function. Cognitive psychology, 38(1), 129-166.
Kahneman, D., & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. Econometrica, 47(2), 263–291.
Prelec, D. (1998). The probability weighting function. Econometrica, 497-527.
Tversky, A., & Kahneman, D. (1992). Advances in prospect theory: Cumulative representation of uncertainty. Journal of Risk and uncertainty, 5, 297-323.
Examples
>>> from cpm.models.activation import ProspectUtility >>> magnitudes = [[5, 0], [10, -10]] >>> probabilities = [[0.8, 0.2], [0.5, 0.5]] >>> model = ProspectUtility( ... magnitudes=magnitudes, ... probabilities=probabilities, ... alpha=0.88, ... lambda_loss=2.25, ... gamma=0.61, ... delta=1.0, ... weighting="tk", ... ) >>> expected_utilities = model.compute() >>> print(expected_utilities)