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 its terminal reinforcement probability. This is interpreted as the \(S^{+}\) reinforcement probability within a signalled alternative.

Usage

s_plus_tr_p(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 terminal reinforcement probability of the identified \(S^{+}\) stimulus, 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_tr_p(TRUE, 10, 20, 0.5, 0.8)
#> [1] 0.5
s_plus_tr_p(TRUE, 10, 20, 0, 0) # Returns NA
#> [1] NA
s_plus_tr_p(FALSE, 10, 20, 0.5, 0.8) # Returns NA
#> [1] NA