simple and scalable statistical modelling in R
simple
scalable
extensible
Here’s a Bayesian linear regression model for the iris
data using greta:
x <- iris$Petal.Length
y <- iris$Sepal.Length
library(greta)
int <- normal(0, 5)
coef <- normal(0, 3)
sd <- lognormal(0, 3)
mean <- int + coef * x
distribution(y) <- normal(mean, sd)
m <- model(int, coef, sd)