a greta extension for hierarchical models
greta.lme
is an extension package for greta
to allow easier building of hierarchical models, such as mixed effect models.
For example, a normal hierarchical model using random intercepts for the iris data set in lme4
formula style:
mod <- greta.glmer(Sepal.Length ~ Sepal.Width + (1 | Species), iris)
sd <- inverse_gamma(1, 1)
distribution(iris$Sepal.Length) <- normal(mod$predictor, sd)
m <- model(mod$coef, mod$gamma)
d <- mcmc(m)
devtools::install_github("greta-dev/greta")
devtools::install_github("dirmeier/greta.lme")
The current greta.lme
release uses the same version numbers as the current greta
release, such that it's easier to see what works together, e.g.
devtools::install_github("greta-dev/greta@0.3.0")
devtools::install_github("dirmeier/greta.lme@0.3.0")
- Simon Dirmeier simon.dirmeier@web.de