eml_bandit2arm: Expectation-Maximization with Laplace approximation (EML) of...

Description Usage Arguments Value Examples

View source: R/estimate_bandit2arm.R

Description

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

Usage

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

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.

iter

iteration of algorithm

eml_data

data to be passed for succeeding iterations

Value

A list containing the sum log-likelihood, eml estimates of parameter 1 per subject, eml 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.