Learn R Programming

binaryRL (version 0.8.9)

func_gamma: Function: Utility Function

Description

Function: Utility Function

Usage

func_gamma(
  value,
  utility,
  reward,
  occurrence,
  var1 = NA,
  var2 = NA,
  gamma = 1,
  lambda
)

Value

Discount rate and utility

Arguments

value

The expected value of the stimulus in the subject's mind at this point in time.

utility

The subjective value that the subject assigns to the objective reward.

reward

The objective reward received by the subject after selecting a stimulus.

occurrence

The number of times the same stimulus has appeared.

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"`

gamma

[vector] Parameters used in the Utility Function `util_func`, often referred to as the discount rate. For example, `utility = reward^gamma`. If `gamma < 1`, it indicates that people tend to discount the objective reward. This equation is very similar to the Stevens' power function, reflecting humans' nonlinear perception of physical quantities. e.g., `gamma = c(0.7)`.

lambda

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