cpt | R Documentation |
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).
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 )
formula |
A formula, the variables in |
data |
A data frame, the data to be modeled. |
choicerule |
A string, the choice rule. Allowed values, see |
ref |
(optional, default: 0) A number, string, or RHS formula, the reference point or the variable in |
fix |
(optional) A list with parameter-value pairs of fixed parameters. If missing all free parameters are estimated. If set to
|
weighting |
(optional) A string, name of the probability weighting function, allowed are |
value |
(optional) A string, the name of the value function. Allowed is only |
options |
(optional) A list, list entries change the modeling procedure. For example, |
mem |
(optional, default: 0) A number, string, or RHS formula, the prior gains or losses in memory. Formula and string refer to variables in |
editing |
(optional) A string, the editing rule to use (see Thaler & Johnson, 1999, pp. 645), currently only |
discount |
A number, how many initial trials to not use during parameter fitting. |
... |
other arguments, ignored. |
Fits cumulative prospect theory.
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()
and cpt_mem_d()
: If choicerule = "softmax"
: tau
is the temperature or choice softness, higher values cause more equiprobable choices. If choicerule = "epsilon"
: eps
is the error proportion, higher values cause more errors from maximizing..
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)
.
Jana B. Jarecki, jj@janajarecki.com
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
Other cognitive models:
baseline_const_c()
,
bayes()
,
choicerules
,
ebm()
,
hm1988()
,
shift()
,
shortfall
,
threshold()
,
utility
## 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)) # View the model M # has a parameter `tau` # 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)) # View the model M # No parameter `tau` # Methods --------------------------------------------------- predict(M, "value") # predict values, also: M$predict("value") predict(M, "mode") # predict choice probability after softmax summary(M) anova(M)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.