This calculator implements the decision-by-sampling model for risky choices reported in Stewart, Chater, and Brown (2006), Stewart and Simpson (2008) and Stewart (2009). You can view an animation illustrating the model. The example R code implements the model for one example of the common ratio effect from Kahneman and Tversky (1979). Pressing "run" submits the code to R and generates predictions, or you can edit the code for your own choices. Predictions appear at the bottom of the output page, and give the probability of selecting each gamble in each choice.
Full source code for the model is available, with worked examples explaining the model in detail.