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.
Arguments
- lex
A
(word x object)matrix of literal meaning weights.- prior
Numeric prior over objects (one per column of
lex). Objects with prior 0 are dropped from the reasoning and get listener probability 0.- ...
Further arguments to the recursion:
alpha(speaker rationality / softmax temperature, default 3),cost(optional per-word production cost vector), anddepth(pragmatic recursions beyond the literal level;0gives the prior-weighted literal listener,1the usual one-step pragmatic one).