# Stimulus control

In behavioral psychology, stimulus control is a phenomenon in operant conditioning that occurs when an organism behaves in one way in the presence of a given stimulus and another way in its absence. A stimulus that modifies behavior in this manner is either a discriminative stimulus or stimulus delta. For example, the presence of a stop sign at a traffic intersection alerts the driver to stop driving and increases the probability that braking behavior occurs. Stimulus control does not force behavior to occur, as it is a direct result of historical reinforcement contingencies, as opposed to reflexive behavior elicited through classical conditioning.
Some theorists believe that all behavior is under some form of stimulus control. For example, in the analysis of B. F. Skinner, verbal behavior is a complicated assortment of behaviors with a variety of controlling stimuli.

## Characteristics

The controlling effects of stimuli are seen in quite diverse situations and in many aspects of behavior. For example, a stimulus presented at one time may control responses emitted immediately or at a later time; two stimuli may control the same behavior; a single stimulus may trigger behavior A at one time and behavior B at another; a stimulus may control behavior only in the presence of another stimulus, and so on. These sorts of control are brought about by a variety of methods and they can explain many aspects of behavioral processes.
In simple, practical situations, for example if one were training a dog using operant conditioning, optimal stimulus control might be described as follows:
* The behavior occurs immediately when the discriminative stimulus is given.
* The behavior never occurs in the absence of the stimulus.
* The behavior never occurs in response to some other stimulus.
* No other behavior occurs in response to this stimulus.

## Establishing stimulus control through operant conditioning
### Discrimination training

Operant stimulus control is typically established by discrimination training. For example, to make a light control a pigeon's pecks on a button, reinforcement only occurs following a peck to the button. Over a series of trials the pecking response becomes more probable in the presence of the light and less probable in its absence, and the light is said to become a discriminative stimulus or S$^D$. Virtually any stimulus that the animal can perceive may become a discriminative stimulus, and many different schedules of reinforcement may be used to establish stimulus control. For example, a green light might be associated with a VR 10 schedule and a red light associated with a FI 20-sec schedule, in which case the green light will control a higher rate of response than the red light.

### Generalization

After a discriminative stimulus is established, similar stimuli are found to evoke the controlled response. This is called stimulus generalization. As the stimulus becomes less and less similar to the original discriminative stimulus, response strength declines; measurements of the response thus describe a generalization gradient.
An experiment by Hanson (1959) provides an early, influential example of the many experiments that have explored the generalization phenomenon. First a group of pigeons was reinforced for pecking a disc illuminated by a light of 550 nm wavelength, and never reinforced otherwise. Reinforcement was then stopped, and a series of different wavelength lights was presented one at a time. The results showed a generalization gradient: the more the wavelength differed from the trained stimulus, the fewer responses were produced.
Many factors modulate the generalization process. One is illustrated by the remainder of Hanson's study, which examined the effects of discrimination training on the shape of the generalization gradient. Birds were reinforced for pecking at a 550 nm light, which looks yellowish-green to human observers. The birds were not reinforced when they saw a wavelength more toward the red end of the spectrum. Each of four groups saw a single unreinforced wavelength, either 555, 560, 570, or 590 nm, in addition to the reinforced 550 wavelength. The birds were then tested as before, with a range of unreinforced wavelengths. This procedure yielded sharper generalization gradients than did the simple generalization procedure used in the first procedure. In addition, however, Hansen's experiment showed a new phenomenon, called the "peak shift". That is, the peak of the test gradients shifted away from the S$^D$, such that the birds responded more often to a wavelength they had never seen before than to the reinforced S$^D$. An earlier theory involving inhibitory and excitatory gradients partially explained the results, A more detailed quantitative model of the effect was proposed by Blough (1975). Other theories have been proposed, including the idea that the peak shift is an example of relational control; that is, the discrimination was perceived as a choice between the "greener" of two stimuli, and when a still greener stimulus was offered the pigeons responded even more rapidly to that than to the originally reinforced stimulus.

## Matching to sample

In a typical matching-to-sample task, a stimulus is presented in one location (the "sample"), and the subject chooses a stimulus in another location that matches the sample in some way (e.g., shape or color). In the related "oddity" matching procedure, the subject responds to a comparison stimulus that does not match the sample. These are called "conditional" discrimination tasks because which stimulus is responded to depends or is "conditional" on the sample stimulus.
The matching-to-sample procedure has been used to study a very wide range of problems. Of particular note is the "delayed matching to sample" variation, which has often been used to study short-term memory in animals. In this variation, the subject is exposed to the sample stimulus, and then the sample is removed and a time interval, the "delay", elapses before the choice stimuli appear. To make a correct choice the subject has to retain information about the sample across the delay. The length of the delay, the nature of the stimuli, events during the delay, and many other factors have been found to influence performance on this task.

## Cannabinoids

Psychoactive cannabinoids produce discriminative stimulus effects by stimulation of CB1 receptors in the brain.