Skip to main content

A PyPI package to model risky choice

Project description

A python package for binary risky choice modeling for 4 models:

  • Expected Utility Theory: $U = p*A^\alpha$
  • Risk-Return: $U = EV - b*Var$
  • Coefficient of Variation: $U = EV - b*CV$ where $CV = \sqrt{Var}/EV1$
  • Hyperbolic: $U = A/(1+h*\theta)$ where $\theta = (1-p)/p$

where $A$ is the payoff amount, $p$ is the probability of winning that outcome, $EV$ is Expected value ($Ap$), and $Var$ is variance ($p(A-EV)^2 + (1 - p)(-EV)^2$)

The package takes risky choice data (probability, payoffs, and decisions) of 2 options as inputs and returns a util-rc object that stores the estimated parameters, inverse temperature, fit metrics, model type, and number of observations in an instance variable named params.

To use the package,copy the following code into your terminal:

>>> pip install util-rc==0.1.9
>>> python3 
>>> from src.util_rc.main import util_rc 
>>> example = util_rc("E",[0,0,1],[10,10,10],[1,1,1],[20,30,40],[.6,.5,.4]) 
>>> example.params

Dependencies: numpy version >= 1.26.4, scipy version >= 1.12.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

util_rc-0.1.9.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

util_rc-0.1.9-py3-none-any.whl (1.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page