No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
inst/include
man
src
tests
tools
vignettes
.Rbuildignore
.gitignore
.travis.yml
DESCRIPTION
LICENSE
NAMESPACE
README.md
beliefupdatr.Rproj

README.md

Belief UpdatR

Build Status codecov

Belief updating for phonetic adaptation in R.

Install

Prerequisites

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')

From github

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.

Getting help

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')

Contents

  • /exec has source for Stan models. You'll need rstan to run them. Construct the full path to the model file like file.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.