estimateWeights {ndl} | R Documentation |
Estimation of the association weights using the equilibrium equations of Danks (2003) for the Rescorla-Wagner equations.
Description
A function to estimate the weights (associative strengths) for cue-outcome pairs when learning is in equilibrium, using the equilibrium equations for the Rescorla-Wagner model of Danks (2003).
Usage
estimateWeights(cuesOutcomes, removeDuplicates=TRUE, saveCounts=FALSE,
verbose=FALSE, trueCondProb=TRUE, addBackground=FALSE, hasUnicode=FALSE, ...)
Arguments
cuesOutcomes |
A data frame with three variables specifying frequency, cues, and
outcomes, that may be created with
|
removeDuplicates |
A logical specifying whether multiple occurrences of a Cue in
conjunction with an individual instance of an Outcome shall each
be counted as a distinct occurrence of that Cue ( |
saveCounts |
A logical specifying whether the co-occurrence matrices should be
saved. If set equal to |
verbose |
If set to |
addBackground |
If you would like to add a background rate for all your cues and outcomes, but did not include an general environment cue to all your events, one will be added for you to the matrices, as specified in Danks (2003). If changed from the default (FALSE) to TRUE, background cues will be added. The name used for the background rates is "Environ", and will be included in the output weight matrix. |
trueCondProb |
The conditional probability calculations used will be those specified in Danks (2003). If changed from the default (TRUE) to FALSE, the normalization specified in Baayen, et al (2011) is used. |
hasUnicode |
A logical specifying whether to apply a UTF-8 to integer conversion to the names of the cues. This was implemented to solve issues with differences Unicode cue names. |
... |
Control arguments to be passed along from |
Details
Using Rcpp, a C++ based implementation processes all of the data in RAM. The module will check the amount of RAM you have available in your system and warn you if the amount of RAM is insufficient to build your model.
For examples of how the cuesOutcomes
data frame should be
structured, see the data sets danks
,
plurals
, and serbian
. N.B. Empty
Cues
or Outcomes
(effectively having length =
0
), e.g. Cues
or Outcomes
strings with an initial or
final underscore or two immediately adjacent underscores, will
result in an error.
Value
A matrix with cue-to-outcome association strengths. Rows are cues, and columns are outcomes. Rows and columns are labeled. If addBackground=T, a row named "Environ" will be added to the output.
Acknowledgements
The assistance of Uwe Ligges in getting the C function cooc
to work within the R framework is greatly appreciated. This C function
was removed in version 0.2.0 and replaced with the C++ function by
Cyrus Shaoul.
Note
Add a note here.
Author(s)
Cyrus Shaoul, R. H. Baayen and Petar Milin, with contributions from Antti Arppe and Peter Hendrix.
References
Baayen, R. H. and Milin, P. and Filipovic Durdevic, D. and Hendrix, P. and Marelli, M. (2011), An amorphous model for morphological processing in visual comprehension based on naive discriminative learning. Psychological Review, 118, 438-482.
See Also
estimateActivations, ndlCuesOutcomes,
danks, plurals, serbian
Examples
data(danks)
estimateWeights(cuesOutcomes=danks)
data(plurals)
plurals$Cues <- orthoCoding(plurals$WordForm, grams=1)
round(estimateWeights(cuesOutcomes=plurals),2)
data(serbian)
serbian$Cues <- orthoCoding(serbian$WordForm, grams=2)
serbian$Outcomes <- serbian$LemmaCase
sw <- estimateWeights(cuesOutcomes=serbian)
round(sw[1:5,1:6],2)