| rsa_listener | R Documentation |
A small, self-contained RSA recursion over a word-by-object meaning matrix
(Frank & Goodman, 2012; Smith, Goodman & Frank, 2013), used by
predict_referent() with pragmatic = TRUE. rsa_listener() returns
P(object | word) for a listener who reasons about an informative speaker;
rsa_speaker() returns P(word | object) for that speaker. Both operate on
any non-negative (word x object) matrix, reading entries as literal
meaning weights.
rsa_listener(lex, prior, ...)
rsa_speaker(lex, prior, ...)
lex |
A |
prior |
Numeric prior over objects (one per column of |
... |
Further arguments to the recursion: |
rsa_listener(): a (word x object) matrix of P(object | word).
rsa_speaker(): a (word x object) matrix of P(word | object).
# "wug" names either object; a pragmatic listener resolves it to the second
lex <- matrix(c(1, 0, 1, 1), 2, byrow = TRUE)
rsa_listener(lex, c(0.5, 0.5), alpha = 3, depth = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.