$$W_{new} = W_{old} + \zeta \cdot (W_{0} - W_{old})$$
Arguments
- value0
The initial values for all actions.
- values
The current expected values for all actions.
- 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_zeta <- function(
value0,
values,
reward,
params,
...
){
# if you need extra information
# e.g.
# Trial <- idinfo["Trial"]
# Frame <- exinfo["Frame"]
zeta <- multiRL:::get_param(params, "zeta")
bonus <- multiRL:::get_param(params, "bonus")
if (reward == 0) {
decay <- values + zeta * (value0 - values)
} else if (reward < 0) {
decay <- values + zeta * (value0 - values) + bonus
} else if (reward > 0) {
decay <- values + zeta * (value0 - values) - bonus
}
return(decay)
}