Skip to contents

Given two terminal link stimuli, identifies the one with the greater reinforcement probability per unit of time (i.e., higher \(p/t\) ratio), and returns its duration. This is interpreted as the \(S^{+}\) duration within a signalled alternative.

Usage

s_plus_dur(sig, tl_dur1, tl_dur2, tr_p1, tr_p2)

Arguments

sig

Logical. Indicates whether the terminal link stimuli are assumed to be discriminable. See sig_check().

tl_dur1

Numeric. Duration of the first terminal link.

tl_dur2

Numeric. Duration of the second terminal link.

tr_p1

Numeric. Probability of terminal (primary/unconditional) reinforcement following the first terminal link.

tr_p2

Numeric. Probability of terminal (primary/unconditional) reinforcement following the second terminal link.

Value

A numeric vector containing the duration of the identified \(S^{+}\) terminal link, or NA if undefined.

Details

If both terminal reinforcement probabilities are 0, or if either terminal link duration is 0, the function returns NA. If the choice alternative is not signalled (sig == FALSE), NA is also returned.

Examples

s_plus_dur(TRUE, 10, 20, 0.5, 0.8)
#> [1] 10
s_plus_dur(TRUE, 10, 20, 0, 0) # Returns NA
#> [1] NA
s_plus_dur(FALSE, 10, 20, 0.5, 0.8) # Returns NA
#> [1] NA