This section describes some of the function arguments in greater detail.data should be assigned a character value specifying the full path and name of the file, including the file extension
(e.g. ".txt"), that contains the behavioral data of all subjects of interest for the current analysis.
The file should be a tab-delimited text (.txt) file whose rows represent trial-by-trial observations and columns
represent variables. For the Risk Aversion Task, there should be four columns of data with the labels
"subjID", "riskyGain", "riskyLoss", and "safeOption". It is not necessary for the columns to be in this
particular order, however it is necessary that they be labelled correctly and contain the information below:
"subjID"
- A unique identifier for each subject within data-set to be analyzed.
"gain"
- Possible (50%) gain outcome of a risky option (e.g. 9).
"loss"
- Possible (50%) loss outcome of a risky option (e.g. 5, or -5).
"cert"
- Guaranteed amount of a safe option. "cert" is assumed to be zero or greater than zero.
"gamble"
- If gamble was taken, gamble == 1, else gamble == 0.
*Note: The data.txt file may contain other columns of data (e.g. "Reaction_Time", "trial_number", etc.), but only the data with the column
names listed above will be used for analysis/modeling. As long as the columns above are present and labelled correctly,
there is no need to remove other miscellaneous data columns.
nwarmup is a numerical value that specifies how many MCMC samples should not be stored upon the
beginning of each chain. For those familiar with Bayesian methods, this value is equivalent to a burn-in sample.
Due to the nature of MCMC sampling, initial values (where the sampling chain begins) can have a heavy influence
on the generated posterior distributions. The nwarmup
argument can be set to a high number in order to curb the
effects that initial values have on the resulting posteriors.
nchain is a numerical value that specifies how many chains (i.e. independent sampling sequences) should be
used to draw samples from the posterior distribution. Since the posteriors are generated from a sampling
process, it is good practice to run multiple chains to ensure that a representative posterior is attained. When
sampling is completed, the multiple chains may be checked for convergence with the plot(myModel, type = "trace")
command. The chains should resemble a "furry caterpillar".
nthin is a numerical value that specifies the "skipping" behavior of the MCMC samples being chosen
to generate the posterior distributions. By default, nthin
is equal to 1, hence every sample is used to
generate the posterior.
Contol Parameters: adapt_delta, stepsize, and max_treedepth are advanced options that give the user more control
over Stan's MCMC sampler. The Stan creators recommend that only advanced users change the default values, as alterations
can profoundly change the sampler's behavior. Refer to Hoffman & Gelman (2014, Journal of Machine Learning Research) for
more information on the functioning of the sampler control parameters. One can also refer to section 58.2 of the
http://mc-stan.org/documentation/ for a less technical description of these arguments.