Random Utility Source Code

This source code implements a simple random utility model of risky choice.

random_utility.R is the library of functions used in the model.

Kahneman and Tverksky (1979) Choices

Kahneman_Tversky_1979_example.R implements the model for the classic risky choices from Kahneman and Tversky (1979). Kahneman_Tversky_1979_data.R contains the choices. See Kahneman_Tversky_1979_example.Rout for output.

Running the Scripts

Put Kahneman_Tversky_1979_example.R, Kahneman_Tversky_1979_data.R and random_utility.R in the same directory. Use the command "R CMD BATCH Kahneman_Tversky_1979_example.R" to run the model. Output will be saved in Kahneman_Tversky_1979_example.Rout.

The scripts were written with R version 2.13.1.

Please send bugs or comments to Neil.Stewart@warwick.ac.uk.

Back to the on-line calculator.