Skip to contents

$$U(R) = {R}^{\gamma}$$

Usage

func_gamma(reward, params, ...)

Arguments

reward

The feedback received by the agent from the environment at trial(t) following the execution of action(a)

params

Parameters used by the model’s internal functions, see params

...

Subject ID, Block ID, Trial ID, and any additional information defined by the user.

Body

func_gamma <- function(
    reward,
    params,
    ...
){
  # if you need extra information
  # e.g.
  # Trial <- idinfo["Trial"]
  # Frame <- exinfo["Frame"]

  gamma     <-  multiRL:::get_param(params, "gamma")

  # Stevens' Power Law
  utility <- sign(reward) * (abs(reward) ^ gamma)

  return(utility)
}