Description Usage Arguments Value Examples
View source: R/SRSA_StratUtt.R
Simple RSA
The simple pragmatic speaker considers all "imaginable" (i.e. implemented) preference distributions over objects of the listener.
Starting with a prior assumption over the possible listener's preferences. It then infers the posterior over these preferences given the listener makes a particular object choice. P(listener's feature value preferences | utterance, object choice by the listener, prior over listener's feature value preferences).
1 2 3 4 5 6 7 8 9 | simplePragmaticSpeakerWithPrefPriorAll(
utterance,
obj,
preferencesPriorAll,
validUtterances,
currentObjects,
uttToObjProbs,
objectPreferenceSoftPriors
)
|
utterance |
The uttered word by the speaker that the listener hears. An index referring to one of the values in the vector validUtterances. |
obj |
The object chosen by the listener. A value referring to the index 1,2 or 3. |
preferencesPriorAll |
A vector of length 9. Probability mass over all feature values. Gives a prior preferences distribution over all (nine) feature values.
|
validUtterances |
A vector of utterances that correspond to all feature values present in the current objects in the scene. For example, it only makes sense to utter "red" in a scene if there are red objects present. |
currentObjects |
Vector of three values in The target is the first object in the vector |
uttToObjProbs |
A matrix. The rows map each possible utterance that corresponds to each present feature value of the current objects. The columns represent the three objects in the scene. This reflects the obedience-parameter and which objects match the respective utterance. The matrix shows the probability that a certain object is chosen following a certain utterance, that is valid in the scene. The number of rows of the matrix match the length of the validUtterances vector. |
objectPreferenceSoftPriors |
A list of preference priors for all valid utterances based on the object in the scene. The list has as many rows as the length of the validUtterances vector + 1. Each row in the list contains a vector of length 3, as there are three objects in the scene. The extra row is for the case of no feature preferences whatsoever, i.e. uniform prior over all three objects in the scene. |
A vector of length 9. It contains the normalized probability over preferences (priors).
1 2 3 4 5 6 | simplePragmaticSpeakerWithPrefPriorAll(utterance, obj,
preferencesPriorAll, validUtterances,
currentObjects, uttToObjProbs, objectPreferenceSoftPriors)
output:
[1] 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12 0.12
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.