Learn R Programming

ndl (version 0.2.18)

plot.RescorlaWagner: Plot function for the output of RescorlaWagner.

Description

This function graphs the Rescorla-Wagner weights for a cue-outcome pair against learning time.

Usage

# S3 method for RescorlaWagner
plot(x, asymptote=TRUE, xlab="t", ylab="weight", ylimit=NA, …)

Arguments

x

A object of the class "RescorlaWagner" produced by RescorlaWagner, consisting of a list including estimated weights for the incremental and equilibrium stages.

asymptote

A logical specifying whether the equilibrium asymptotic weight should be added to the plot.

xlab

Label for x-axis, by default "t".

ylab

Label for y-axis, by default "weight".

ylimit

The range of values to be displayed on the Y axis. By default, this will be determined from the data itself.

Arguments to be passed to methods, such as graphical parameters (see link{par}).

Value

A plot is produced on the graphics device.

References

Danks, D. (2003). Equilibria of the Rescorla-Wagner model. Journal of Mathematical Psychology, 47 (2), 109-121.

Rescorla, R. A., & Wagner, A. R. (1972). A theory of Pavlovian conditioning: Variations in the effectiveness of reinforcement and nonreinforcement. In Black, A. H., & Prokasy, W. F. (Eds.), Classical conditioning II: Current research and theory (pp. 64-99). New York: Appleton-Century-Crofts.

See Also

RescorlaWagner, orthoCoding

Examples

Run this code
# NOT RUN {
data(lexample)
lexample$Cues <- orthoCoding(lexample$Word, grams=1)
lexample.rw <- RescorlaWagner(lexample, nruns=25, 
   traceCue="h", traceOutcome="hand")
plot(lexample.rw)
mtext("h - hand", 3, 1)

# Full example

# }
# NOT RUN {
par(mfrow=c(2,2))
lexample.rw <- RescorlaWagner(lexample, nruns=25, 
   traceCue="h", traceOutcome="hand")
plot(lexample.rw)
mtext("h - hand", 3, 1)

lexample.rw <- RescorlaWagner(lexample, nruns=25, 
   traceCue="s", traceOutcome="plural")
plot(lexample.rw)
mtext("s - plural", 3, 1)

lexample.rw <- RescorlaWagner(lexample, nruns=25, 
   traceCue="a", traceOutcome="as")
plot(lexample.rw)
mtext("a - as", 3, 1)

lexample.rw <- RescorlaWagner(lexample, nruns=25, 
   traceCue="s", traceOutcome="as")
plot(lexample.rw)
mtext("s - as", 3, 1)
par(mfrow=c(1,1))
# }

Run the code above in your browser using DataLab