simpleBestInfGainUtteranceWithPrefPriorAll: Iterative utterance choice function. Utterance preferences of...

Description Usage Arguments Details Value Examples

View source: R/SRSA_StratUtt.R

Description

Simple RSA

This function calculates the utility of the utterances. The utterance with the highest utility delivers the best information gain for the speaker about the feature preferences of the listener.

This function is used in the iterative scenarios.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
simpleBestInfGainUtteranceWithPrefPriorAll(
  preferencesPriorAll,
  validUtterances,
  currentObjects,
  uttToObjProbs,
  objectPreferenceSoftPriors,
  klValueFactor = 1,
  targetFeature,
  utterancePrior
)

Arguments

preferencesPriorAll

A vector of length 9.

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 {1,...,27} specifying the target and the other two objects.

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.

klValueFactor

(here set to = 1) can be negative, 0 or positive:

zero

Don't care about learning about feature preferences of the listener

positive

Care about learning about feature preferences of the listener

negative

Trying to pick non-ambiguous utterances

targetFeature

A value between 1 and 3, specifying which feature type- color, shape, or pattern- is considered (for preferences).

utterancePrior

A vector of the same length of the validUtterances vector. It contains zeros.

utterancePrior <- rep(0,length(validUtterances))

Details

iterative-version of simpleBestInfGainUtterance

Value

posterior preferences over feature values: 3 dimensional array for simulated preferences.

rows: utterances, columns: preferences, blocks: objects.

It contains the normalized probability over utterances given the listener's object preference priors.

U(utterances | listener's object preference priors).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
simpleBestInfGainUtteranceWithPrefPriorAll(preferencesPriorAll,
validUtterances, currentObjects, uttToObjProbs,
objectPreferenceSoftPriors, klValueFactor = 1, targetFeature, utterancePrior)

output:
[[1]]
[1] 0  0  0  0.26  0.088  0.65

[[2]]
, , 1

      [,1]   [,2]  [,3]  [,4] [,5] [,6] [,7] [,8] [,9]
[1,]   0       0     0     0    0    0    0    0    0
[2,]   0       0     0     0    0    0    0    0    0
[3,]   0       0     0     0    0    0    0    0    0
[4,] 0.66   0.0065  0.33   0    0    0    0    0    0
[5,]   0       0     0     0    0    0    0    0    0
[6,] 0.98    0.01   0.01   0    0    0    0    0    0

, , 2

      [,1]   [,2]  [,3]  [,4] [,5] [,6] [,7] [,8] [,9]
[1,]   0       0     0     0    0    0    0    0    0
[2,]   0       0     0     0    0    0    0    0    0
[3,]   0       0     0     0    0    0    0    0    0
[4,] 0.065   0.66   0.33   0    0    0    0    0    0
[5,]   0       0     0     0    0    0    0    0    0
[6,]  0.01   0.98   0.01   0    0    0    0    0    0

, , 3

     [,1]    [,2]  [,3]  [,4] [,5] [,6] [,7] [,8] [,9]
[1,]   0       0     0     0    0    0    0    0    0
[2,]   0       0     0     0    0    0    0    0    0
[3,]   0       0     0     0    0    0    0    0    0
[4,]   0       0     0     0    0    0    0    0    0
[5,]  0.33   0.33   0.33   0    0    0    0    0    0
[6,] 0.0097 0.0097  0.98   0    0    0    0    0    0

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