| predict_referent | R Documentation |
Given a model's word-object association matrix, returns the probability
distribution over a trial's candidate objects for one heard word – the
quantity to compare against a participant's choice on a referent-selection
(m-alternative forced choice) trial. This is model-agnostic: it works on the
matrix of any xslFit (or any word-by-object matrix), reading each entry
as an association strength / meaning weight.
predict_referent(
m,
word,
objects,
prior = NULL,
pragmatic = FALSE,
threshold = NULL,
rsa_alpha = 3,
depth = 1
)
m |
A word-by-object association matrix (e.g.
|
word |
The heard word: a row name of |
objects |
The candidate objects present on the trial: column names of
|
prior |
Optional prior over |
pragmatic |
If |
threshold |
Optional; binarize |
rsa_alpha, depth |
Speaker rationality and recursion depth for the RSA
listener (only used when |
The literal rule is Bayes' rule on the word's row,
P(object | word) proportional to m[word, object] * prior(object),
normalized over the objects present. With pragmatic = TRUE the objects are
instead resolved by a one-step Rational Speech Act pragmatic listener
(rsa_listener()), which additionally reasons that the speaker could have
used a different word – this is what yields strong mutual exclusivity when
a heard word is lexically ambiguous and a competitor word names one of the
candidates. A truly novel (unseen) word carries no lexical evidence and
returns the prior in either mode.
A numeric vector of probabilities over objects, in the given
order, summing to 1.
m <- xsl_run(fgt2009(alpha = 1), get_example_unambiguous_condition())$fits[[1]]$matrix
predict_referent(m, 1, c(1, 2, 3))
predict_referent(m, 1, c(1, 2, 3), prior = c(1, 0, 1)) # object 2 unavailable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.