pragmaticSpeaker: Pragmatic Speaker function

Description Usage Arguments Value Examples

View source: R/RSA_StratUtt.R

Description

Full-RSA

This pragmatic speaker considers all "imaginable" (i.e. implemented) preference distributions - over objects - of the listener.

It starts with a prior assumption over the possible preferences of the listener. Then it infers the posterior over these preferences given an object choice of the listener i.e. P(listener's feature value preferences | utterance, object choice by the listener, prior over preferences)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pragmaticSpeaker(
  utterance,
  obj,
  preferencesPrior,
  validUtterances,
  currentObjects,
  uttToObjProbs,
  objectPreferenceSoftPriors,
  alpha
)

Arguments

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.

preferencesPrior

A vector of length 9.

Probability mass over all feature values present in the scenario plus a "no preference" case.

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

A vector of three values in {1,...,27} specifying the target and the other two objects in the scene.

The target is the first object in the vector (index = 1).

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.

alpha

A parameter between 0 and 1.

Exponential scaling of the speaker choosing the utterance that maximizes the chance of the listener getting the target object right.

Value

A vector with the same as the validUtterances vector.

Normalized posterior probability over preferences- given the utterance, the object choice by the listener, and prior over preferences of the listener.

Examples

1
2
3
4
5
pragmaticSpeaker(utterance, obj, preferencesPrior, validUtterances,
currentObjects, uttToObjProbs, objectPreferenceSoftPriors, alpha)

output:
[1] 0.17 0.17 0.17 0.17 0.17 0.17

haniaelkersh/rsa-publish-test documentation built on Jan. 31, 2021, 2:02 a.m.