Belief updating for phonetic adaptation in R.
Parts of this package depend on having a working developer environment. You may already have these, but if not:
- Mac OS: install XCode (from the App Store)
- Windows: install RTools
- Linux: you probably know what you're doing.
The RStan installation instructions walk through this process in more detail.
Finally, install devtools
if it's not already installed:
install.packages('devtools')
Second, install this package from github.
devtools::install_github('kleinschmidt/beliefupdatr', args = "--preclean")
If you want to build the vignettes (long-form documentation), there are
additional dependencies. To install this package with optional dependencies
(Suggests
in the DESCRIPTION
file) and build the vignettes:
devtools::install_github('kleinschmidt/beliefupdatr', args = "--preclean",
dependencies=TRUE, build_vignettes=TRUE)
This will take a bit longer, because the vignettes run some simulations.
Functions are documented in the usual way:
help(package='beliefupdatr')
?beliefupdatr::d_nix2_predict
# or
library(beliefupdatr)
?d_nix2_predict
Long-form documentation is available in the form of vignettes:
vignette(package='beliefupdatr')
vignette('conjugate-updating')
Or to open a list of vignettes in your web browser:
browseVignettes(package='beliefupdatr')
/exec
has source for Stan models. You'll needrstan
to run them. Construct the full path to the model file likefile.path(devtools::inst('beliefupdatr'), 'exec', '<model.stan>')
./R/nix.R
: helper functions for the Normal-Chi^-2 distribution which is a conjugate prior on a Normal distribution with unknown mean and variance.