greta-dev / greta

simple and scalable statistical modelling in R
https://greta-stats.org
Other
518 stars 63 forks source link

greta is an R package for writing statistical models and fitting them by MCMC and optimisation

greta lets you write your own model like in BUGS, JAGS and Stan, except that you write models right in R, it scales well to massive datasets, and it’s easy to extend and build on.

See the website for more information, including tutorials, examples, package documentation, and the greta forum.

You can install the current release version of the package from CRAN:

install.packages("greta")

Or install the development version of greta from r-universe:

# Enable this universe
options(
  repos = c(
    gretadev = 'https://greta-dev.r-universe.dev',
    CRAN = 'https://cloud.r-project.org'
    )
  )

# Install greta
install.packages('greta')

(Note - installing from r-universe is just like installing from CRAN, and should be faster and more convenient than installing from GitHub)

You can also install the development version of greta via GitHub:

devtools::install_github("greta-dev/greta")

Installing Python Dependencies

The install_greta_deps() function helps install the Python dependencies (Google's TensorFlow version 1.14.0, and tensorflow-probability version 0.7.0).

This helper function, install_greta_deps(), installs the exact pythons package versions needed. It also places these inside a "greta-env" conda environment. This isolates these exact python modules from other python installations, so that only greta will see them. This helps avoids installation issues, where previously you might update tensorflow on your computer and overwrite the current version needed by greta. Using this "greta-env" conda environment means installing other python packages should not be impact the Python packages needed by greta.

If these python modules aren't yet installed, when greta is used, it provides instructions on how to install them for your system. If in doubt follow those.

Codecov test coverage R-CMD-check cran
version license doi joss