map_bandit2arm: Maximum A Posteriori (MAP) of behavior of the two-armed...

Description Usage Arguments Value Examples

View source: R/estimate_bandit2arm.R

Description

This function runs the MAP technique to recover behavior from the simulated task data.

Usage

1
2
3
4
5
6
7
8
9
map_bandit2arm(
  data = bandit2arm_data,
  param = list(init.x1, init.x2),
  prior.mean = c(0, 0),
  prior.sd = c(5, 5),
  fn = "map.objectiveFunction",
  opt = "TRM",
  nRes = 5
)

Arguments

data

simulated two-armed bandit data

param

randomly generated initial parameters.

prior.mean

mean priors for x1 and x2, respectively. Defaults to mean 0 for both parameters.

prior.sd

standard deviation priors for x1 and x2, respectively. Defaults to 5 for both parameters.

fn

objective function being minimized

opt

optimization algorithm used. Defaults to trust-region method (trm)

nRes

number of restarts. Defaults to 5.

Value

A list containing the sum log-likelihood, map estimates of parameter 1 per subject, map estimates of parameter 2 per subject, laplace values of parameter 1 per subject, laplace values of parameter 2 per subject.

Examples

1

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