Skip to contents

Fit model to IGT data either by MLE/MAP, or full posterior sampling

Usage

fitIGT(
  choices,
  wins,
  losses = NULL,
  numDecks,
  utility,
  updating,
  temperature,
  pars = NULL,
  scale = 0.01,
  reg = 1,
  method = "optimize",
  returnStanobj = F,
  ...
)

Arguments

choices

Integer vector of deck choices

wins

Vector of wins. If only net outcomes are observed, they should be provided here.

losses

Vector of losses. May be omitted if only net outcomes are observed.

numDecks

Integer. Number of decks

utility

Name of utility function

updating

Name of updating function

temperature

Name of temperature function

pars

A named list of parameters. See details.

scale

Scaling factor for observed outcomes. Typically, outcomes are divided by 100, corresponding to scale = .01

reg

Positive regularization parameter. A Beta(reg,reg) prior is placed over the range of each parameter, with larger values of reg giving a tighter concentration around the midpoint of the interval. Default value of 1 gives a uniform prior.

method

Either "optimize" for MAP (MLE when reg = 1), or "sample" for full posterior sampling via Stan's No-U-Turn-Sampler (NUTS).

returnStanobj

Whether to return the full cmdstan object.

...

Optional arguments provided to cmdstan::optimize() or cmdstan::sample()

Value

A list containing either estimated, or full posterior samples for all parameters.

Details

Argument "pars" is a named list with fields:

  • "utility": A named list of parameter values. Names must correspond to the parameters of the utility function specified by argument "utility". Each parameter must be a vector of length 2, giving lower and upper bounds.

  • "updating": See above.

  • "temperature": See above.

Note that any or all parameters may be omitted, in which case default bounds will be selected based on conventions in the literature. If any of "utility", "updating", or "temperature" are missing, default bounds will be selected for all parameters.

The user may pass optional arguments to rstan::sampling() or rstan::optimizing(). In the absence of such arguments, the function uses the defaults.