Learn R Programming

ndl (version 0.2.18)

estimateActivations: Estimation of the activations of outcomes (meanings)

Description

estimateActivations is used to estimate the activations for outcomes (meanings) using the equilibrium association strengths (weights) for the Rescorla-Wagner model.

Usage

estimateActivations(cuesOutcomes, weightMatrix, unique=FALSE, …)

Arguments

cuesOutcomes

A data frame with three variables specifying frequency, cues, and outcomes:

Cues

A character vector specifying the cues. When there is more than one cue, the cues should be separated by underscores.

Outcomes

A character vector specifying the outcomes. When there is more than one outcome, the outcomes should be separated by underscores.

Frequency

A numeric vector specifying the frequency with which a combination of cues and outcomes occurs.

weightMatrix

A numeric matrix with as dimensions the number of cues (horizontal) and number of outcomes (vertical). Rows and columns should be labeled with cues and outcomes.

unique

A logical that, if =TRUE, removes duplicate rows from the activation matrix.

Control arguments to be passed along from ndlClassify and/or ndlCrossvalidate.

Value

A list with the following components:

activationMatrix

A matrix with as dimensions, for rows, the number of exemplars (by-row cue sets, typically word forms), and for columns, the number of unique outcomes (meanings), specifying the activation of a meaning given the cues in the input for a given exemplar.

newCues

A vector of cues encountered in cuesOutcomes which were not present in weightMatrix.

Control arguments to be passed along from ndlClassify, and/or ndlCrossvalidate.

Details

The activation of an outcome is defined as the sum of the weights on the incoming links from active cues. When the input (the Cues in cuesOutcomes) contain elements that are not present in the rownames of the weightMatrix, such new cues are added to the weightMatrix with zero entries. The set of exemplars in cuesOutcomes may contain rows with identical cue sets but different outcome sets. Consequently, for such rows, identical vectors of activations of outcomes are generated. In the activation matrix returned by estimateActivations, such duplicate entries are removed.

For examples of how the cuesOutcomes data frame should be structured, see the data sets danks, plurals, and serbian. For examples of how the weightMatrix should be structured, see the corresponding output of estimateWeights.

References

Baayen, R. H. and Milin, P. and Filipovic Durdevic, D. and Hendrix, P. and Marelli, M., An amorphous model for morphological processing in visual comprehension based on naive discriminative learning. Psychological Review, 118, 438-482.

See Also

estimateWeights, danks, plurals, serbian

Examples

Run this code
# NOT RUN {
  data(serbian)
  serbian$Cues <- orthoCoding(serbian$WordForm, grams=2)
  serbian$Outcomes <- serbian$LemmaCase
  sw <- estimateWeights(cuesOutcomes=serbian)
  sw[1:5,1:6]
  activations <- estimateActivations(unique(serbian["Cues"]), sw)$activationMatrix
  rownames(activations) <- unique(serbian[["WordForm"]])
  activations[1:5,1:6]

  syntax <- c("acc", "dat", "gen", "ins", "loc", "nom", "Pl", "Sg") 
  activations2 <- activations[,!is.element(colnames(activations),syntax)]
  head(rownames(activations2), 50)
  head(colnames(activations2), 8)
  image(activations2, xlab="word forms", ylab="meanings", xaxt="n", yaxt="n")
  mtext(c("yena", "...", "zvuke"), side=1, line=1, at=c(0, 0.5, 1), adj=c(0,0,1))
  mtext(c("yena", "...", "zvuk"), side=2, line=1, at=c(0, 0.5, 1), adj=c(0,0,1))
# }

Run the code above in your browser using DataLab