Skip to contents

Calculates the terminal reinforcement rate given initial link (IL) durations, terminal link (TL) duration, terminal reinforcement probability, and schedule types. Optionally computes a common effective IL duration when both schedules are variable interval (VI).

Usage

r(
 il_dur1, il_dur2,
 tl_dur1, tr_p,
 il_sched1, il_sched2,
 common_il_dur = FALSE
 )

Arguments

il_dur1

Duration of the first alternative's IL.

il_dur2

Duration of the second alternative's IL.

tl_dur1

Duration of the first alternative's TL.

tr_p

Probability of terminal reinforcement.

il_sched1

Schedule type for the initial links. (e.g., "VI" or "FR"). See choice_params() for additional details about inputting schedule types.

il_sched2

Schedule type for the second alternative's initial link.

common_il_dur

Logical; if TRUE, a common initial link (IL) duration is computed, but only when both IL schedules are "VI". If FALSE, the reinforcement rate is computed using only the first alternative's IL duration, regardless of schedule type.

Value

A numeric value (or vector) giving the computed terminal reinforcement rate.

Details

When using vectorised inputs, arguments of differing lengths will be recycled according to R's standard vector recycling rules. If lengths are not compatible (i.e., not clean multiples), a warning may be issued. See base::Arithmetic() for details.

See also

Examples

r(il_dur1 = 90, il_dur2 = 30, tl_dur1 = 30, tr_p = 1.0,
  il_sched1 = "VI", il_sched2 = "VI", common_il_dur = TRUE)
#> [1] 0.01904762

r(il_dur1 = 90, il_dur2 = NULL, tl_dur1 = 30, tr_p = 1.0,
  il_sched1 = "VI", il_sched2 = "VI", common_il_dur = FALSE)
#> [1] 0.008333333