Learn R Programming

binaryRL (version 0.8.9)

func_epsilon: Function: Epsilon Greedy

Description

Function: Epsilon Greedy

Usage

func_epsilon(i, var1 = NA, var2 = NA, threshold = 1, epsilon = NA, lambda)

Value

explore or not

Arguments

i

The current row number. The `threshold` for random selection, which is used to explore the value of different options, will be determined based on this row number. This is because I believe that in the early stages of an experiment, participants will choose options completely at random to explore the reward value associated with each option.

var1

[character] column name of extra variable 1. If your model uses more than just reward and expected value, and you need other information, such as whether the choice frame is Gain or Loss, then you can input the 'Frame' column as var1 into the model. e.g., `var1 = "Extra_Var1"`

var2

[character] column name of extra variable 2. If one additional variable, var1, does not meet your needs, you can add another additional variable, var2, into your model. e.g., `var2 = "Extra_Var2"`

threshold

[integer] the number of initial trials during which the subject makes random choices rather than choosing based on the values of the options. This occurs because the subject has not yet learned the values of the options. For example, `threshold = 20` means the subject will make completely random choices for the first 20 trials. default: `threshold = 1`

epsilon

[vector] Parameters used in the Exploration Function `expl_func` determining whether the subject makes decisions based on the relative values of the left and right options, or chooses completely randomly. For example, when epsilon = 0.1, it means the subject has a 10 chance of making a completely random choice and a 90 based on the values of the options. e.g., `epsilon = c(0.1)`

lambda

[vector] Extra parameters that may be used in functions. e.g., `lambda = c(0.4, 0.7, 20, 60)`