Multiple Poisson regression

A multiple Bayesian linear regression model using the warpbreaks data.

data("warpbreaks")
X <- as_data(model.matrix(breaks ~ wool + tension, warpbreaks))
y <- as_data(warpbreaks$breaks)
int <- variable()
coefs <- normal(0, 5, dim = ncol(X) - 1)
beta <- c(int, coefs)

eta <- X %*% beta

distribution(y) <- poisson(exp(eta))


greta-dev/greta documentation built on Dec. 21, 2024, 5:03 a.m.