
Cumulative Prospect Theory Models
cpt.Rd
Fits cumulative prospect theory, CPT (Tversky & Kahneman, 1992).
cpt_d()
fits CPT for discrete responses = choices.cpt_c()
fits CPT for continuous responses = utility values.cpt_mem_d()
fits CPT with an editing step based on memory for discrete responses = choices (Thaler & Johnson, 1990).cpt_mem_c()
fits CPT with an editing step based on memory for continuous responses = utility values (Thaler & Johnson, 1990).
Usage
cpt_d(
formula,
data,
choicerule,
ref = 0L,
fix = list(),
weighting = c("TK1992"),
value = c("TK1992"),
options = NULL
)
cpt_c(
formula,
data,
ref = 0L,
fix = list(),
weighting = c("TK1992"),
value = c("TK1992"),
options = NULL
)
cpt_mem_d(
formula,
mem,
data,
fix = list(),
choicerule,
editing = "hedonic",
weighting = c("TK1992"),
value = c("TK1992"),
options = NULL
)
cpt_mem_c(
formula,
mem,
data,
fix = list(),
editing = "hedonic",
weighting = c("TK1992"),
value = c("TK1992"),
options = NULL
)
Arguments
- formula
A formula, the variables in
data
to be modeled. For example,y ~ x1 + p2 + x3 + p4 | x5 + p6 + x7 + p8
models response y as function of two stimuli with features x1, p2, x3, p4 and x5, p6, x7, p8, alternating outcomesx
and probabilitiesp
(respectively). Lines|
separate stimuli.- data
A data frame, the data to be modeled.
- choicerule
A string, the choice rule. Allowed values, see
cm_choicerules()
:"none"
is no choice rule,"softmax"
is soft-maximum,"luce"
is Luce's axiom.- ref
(optional, default: 0) A number, string, or RHS formula, the reference point or the variable in
data
that holds the reference point. For example~ ref
.- fix
(optional) A list with parameter-value pairs of fixed parameters. If missing all free parameters are estimated. If set to
"start"
all parameters are fixed to their start values. Model parameter names arealpha
,beta
,gammap
,gamman
,lambda
(see details - model parameters).list(alpha = 1.08)
sets parameteralpha
equal to 1.08.list(alpha = "beta")
sets parameteralpha
equal to parameterbeta
(estimatesbeta
).list(beta = "alpha", alpha = 1.08)
sets parameterbeta
equal to parameteralpha
and setsalpha
equal to 1.08 (estimates none of the two).list(alpha = NA)
omits the parameteralpha
, if possible."start"
sets all parameters equal to their initial values (estimates none). Useful for building a first test model.
- weighting
(optional) A string, name of the probability weighting function, allowed are
"KT1992"
for the weighting in Kahneman & Tversky (1992) andNA
for no weighting.- value
(optional) A string, the name of the value function. Allowed is only
"KT1992"
for the value function in Kahneman & Tversky (1992) andNA
for no value transformation.- options
(optional) A list, list entries change the modeling procedure. For example,
list(lb = c(k=0))
changes the lower bound of parameter k to 0, orlist(fit_measure = "mse")
changes the goodness of fit measure in parameter estimation to mean-squared error, for all options, see cm_options.- mem
(optional, default: 0) A number, string, or RHS formula, the prior gains or losses in memory. Formula and string refer to variables in
data
, for example~ xoutc
.- editing
(optional) A string, the editing rule to use (see Thaler & Johnson, 1999, pp. 645), currently only
"hedonic"
.- discount
A number, how many initial trials to not use during parameter fitting.
- ...
other arguments, ignored.
Value
Returns a cognitive model object, which is an object of class cm. A model, that has been assigned to m
, can be summarized with summary(m)
or anova(m)
. The parameter space can be viewed using pa. rspace(m)
, constraints can be viewed using constraints(m)
.
Details
Fits cumulative prospect theory.
Parameter Space
The model has the following free parameters:
alpha
the utility exponent for positive outcomes.beta
the utility exponent for negative outcomes.gammap
the probability distortion for positive outcomes.gamman
the utility exponent for negative outcomes.lambda
the loss aversion.In
cpt_d()
andcpt_mem_d()
: Ifchoicerule = "softmax"
:tau
is the temperature or choice softness, higher values cause more equiprobable choices. Ifchoicerule = "epsilon"
:eps
is the error proportion, higher values cause more errors from maximizing..
References
Tversky, A., & Kahneman, D. (1992). Advances in prospect theory: cumulative representation of uncertainty. Journal of Risk and Uncertainty, 5, 297–-323. doi:10.1007/BF00122574
Thaler, R. H., & Johnson, E. J. (1990). Gambling with the House Money and Trying to Break Even: The Effects of Prior Outcomes on Risky Choice. Management Science, 36(6), 643--660. doi:10.1287/mnsc.36.6.643
See also
Other cognitive models:
baseline_const_c()
,
bayes()
,
choicerules
,
ebm()
,
hm1988()
,
shift()
,
shortfall
,
threshold()
,
utility
Author
Jana B. Jarecki, jj@janajarecki.com
Examples
## From Tversky, A., & Kahneman, D. (1992).
dt <- data.frame(
x1 = c(100, -100),
px = 1,
x2 = 0,
y1 = c(200, -200),
py = c(.71,.64),
y2 = 0,
rp = 1)
# Make the model -------------------------------------------
# add fix parameters (don't fit)
# using the Parameter from the paper
# Discrete responses with choicerule
M <- cpt_d(rp ~ x1 + px + x2 | y1 + py + y2, ref = 0,
choicerule = "softmax", data = dt,
fix = list(alpha = 0.88, beta = 0.88, lambda = 2.25,
gammap = 0.61, gamman = 0.69, tau = 1))
#> Fitting free parameters [tau] by maximizing loglikelihood (binomial pdf) with grid, solnp.
# View the model
M # has a parameter `tau`
#> CPT (TK1992) | choice rule: softmax
#> Call:
#> cpt_d(formula = rp ~ x1 + px + x2 | y1 + py + y2, data = dt, ...
#>
#> Free parameters: estimates
#> tau
#> 0.016
#>
#> Constrained and fixed parameters:
#> alpha beta gammap gamman lambda
#> 0.88 0.88 0.61 0.69 2.25
#>
#> ---
#> Note: View constraints by constraints(.), view parameter space by parspace(.)
# Continuous responses/utility
M <- cpt_c(rp ~ x1 + px + x2 | y1 + py + y2, ref = 0,
data = dt,
fix = list(alpha = 0.88, beta = 0.88, lambda = 2.25,
gammap = 0.61, gamman = 0.69))
#> Fitting free parameters [sigma] by maximizing loglikelihood (normal pdf) with grid, solnp.
#> Warning:
#> solnp-->warning: Equal Lower/Upper Bounds Found. Consider
#>
#> excluding fixed parameters.
#> No optimal parameters found. The solver did not converge.
#> NULL
# View the model
M # No parameter `tau`
#> CPT (TK1992) | choice rule: none
#> Call:
#> cpt_c(formula = rp ~ x1 + px + x2 | y1 + py + y2, data = dt, ...
#>
#> Free parameters: estimates (NOT CONVERGED! see m$fitobj$status)
#> sigma
#> -0.05
#>
#> Constrained and fixed parameters:
#> alpha beta gammap gamman lambda
#> 0.88 0.88 0.61 0.69 2.25
#>
#> ---
#> Note: View constraints by constraints(.), view parameter space by parspace(.)
# Methods ---------------------------------------------------
predict(M, "value") # predict values, also: M$predict("value")
#> Error in private$get_input(f = self$formula, d = newdata, ...): Can't find variables from 'formula' in 'data': [x1, px, x2, I(1 - px), y1, py, y2, I(1 - py)].
predict(M, "mode") # predict choice probability after softmax
#> Error in private$get_input(f = self$formula, d = newdata, ...): Can't find variables from 'formula' in 'data': [x1, px, x2, I(1 - px), y1, py, y2, I(1 - py)].
summary(M)
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#>
#> Model:
#> with no choice rule
#> Call:
#> rp ~ x1 + px + x2 + I(1 - px) | y1 + py + y2 + I(1 - py)
#>
#> (Constrained) Parameters:
#> Estimate
#> (alpha) 0.88
#> (beta) 0.88
#> (gammap) 0.61
#> (gamman) 0.69
#> (lambda) 2.25
#> sigma -0.05
#>
#> Fit Measures:
#> MSE: 10110, LL: NaN, AIC: NaN, BIC: NaN
#>
anova(M)
#> Sum Sq. Table
#> N Par Sum Sq Mean Sq
#> 1 20221 10110