estimate_bandit2arm: Estimate behavior from the two-armed bandit task

Description Usage Arguments Value Examples

View source: R/estimate_bandit2arm.R

Description

This function performs parameter estimation to recover behavior from the simulated task data.

Usage

1
estimate_bandit2arm(data = bandit2arm_data, method = "mle", plot = TRUE)

Arguments

data

simulated two-armed bandit task data

method

parameter estimation technique used; either maximum-likelihood estimation (mle), maximum a posteriori (map) or expectation-maximization with laplace approximation (eml). Defaults to mle.

plot

visualize estimation performance between true parameters vs estimated parameters. Defaults to TRUE.

Value

A plot illustrating the correlation between the true parameters and estimated parameters, and a list containing a dataframe of the true and estimated parameter values, the correlation value of parameter 1, and the correlation value of parameter 2.

Examples

1
2
3
4
5
# Save simulated task data to a variable, say, bandit2arm_data
bandit2arm_data <- simulated_bandit2arm(trials.unique = TRUE)

# Recover behavioral parameters using maximum-likelihood estimation (MLE)
estimate_bandit2arm(data = bandit2arm_data, method = "mle", plot=TRUE)

psuthaharan/bandit2arm documentation built on Jan. 26, 2021, 1:36 a.m.