View source: R/model-fgt2009.R
| fgt2009 | R Documentation |
A joint Bayesian model that infers a lexicon – a set of word-object
edges – from the whole corpus at once, marginalizing over the speaker's
latent referential intention on each trial. Words are generated either
referentially (probability gamma, naming an object in the intention) or
non-referentially (1 - gamma, with in-lexicon words down-weighted by
kappa); a geometric prior P(L) proportional to exp(-alpha |L|) favors
small lexicons. Inference is MCMC (blocked per-object Gibbs plus MI-biased
single-edge Metropolis moves), and xslFit$matrix holds the resulting
posterior edge marginals P(word names object | corpus).
fgt2009(
alpha,
gamma = 1,
kappa = 0.5,
n_chains = 4L,
n_warmup = 120L,
n_samples = 300L,
gibbs_per = 1L,
edge_per = 1L,
top_k = 6L,
seed = 1L
)
alpha |
Geometric lexicon-size prior: |
gamma |
Probability that a word is used referentially. |
kappa |
Down-weight applied to an in-lexicon word used
non-referentially (only relevant when |
n_chains, n_warmup, n_samples, gibbs_per, edge_per, top_k, seed |
Sampler
controls. Defaults are tuned for the small, dense corpora of XSL
experiments; raise |
This is a batch model, unlike the incremental associative models in this
package: it has no trial-by-trial learning trajectory, and control$reps is
ignored. Ported from the Python package wordlearn
(github.com/mcfrank/wurwur); see also fgt2009_rsa() for the pragmatic
extension.
alpha scales with corpus size (larger corpora want a larger alpha) and
the fit-vs-alpha curve is single-peaked, so alpha is best chosen with a
sweep (see fgt2009_sweep_alpha()) rather than a general-purpose optimizer.
gamma and kappa default to the values used for the analogous
cross-situational simulation in the source package
(gamma = 1: every word in a controlled XSL experiment is a referential
label, so there is no non-referential channel; kappa = 0.5). The
naturalistic-speech values are gamma = 0.1, kappa = 0.05.
An object of class xslMod
mod <- fgt2009(alpha = 1)
xsl_run(mod, get_example_ambiguous_condition())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.