iowa

Modular RL models of the Iowa gambling task
Published

July 23, 2024

The iowa package implements modular reinforcement learning models of the Iowa gambling task, using cmdstan as a backend.

The package allows both the simulation and fitting of models constructed by mixing and matching various utility, updating, and temperature functions; and is designed to be relatively extensible by allowing users to implement custom model components and deck structures, which may then be used relatively seamlessly with the functions already implemented in the package.

In addition to simulating the performance of custom models, iowa also allows model fitting either by maximum likelihood / maximum a posteriori estimation, or by full posterior sampling. Currently, only single subject fitting is supported, but support for full hierarchical Bayesian fitting is a strong priority.

For more information, see the documentation.

Installation

Models in iowa are pre-compiled using cmdstanr, which must be installed alongside cmdstan. Both can be installed within R using

remotes::install_github("stan-dev/cmdstanr")
cmdstanr::install_cmdstan()

iowa can then be installed directly from its repository:

remotes::install_github('areshenk-rpackages/iowa', 
                        type = 'source')