knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The goal of iNZightBayes is to ...
You can install the released version of iNZightBayes from CRAN with:
# install.packages("iNZightBayes")
And the development version from GitHub with:
# install.packages("devtools") devtools::install_github("iNZightVIT/iNZightBayes")
library(iNZightBayes) post <- estimate_mean(~Sepal.Width, data = iris) summary(post) plot(post)
In some cases, the posterior can be calculated exactly.
post <- estimate_proportions(c(20, 50, 30), alpha = c(10, 10, 10)) summary(post) plot(post)
There's also linear regression:
# temporary syntax: y <- iris$Sepal.Length x <- cbind(iris$Sepal.Width) post <- gibbs_lm(y, x, 100) par(mfrow = c(1, 2)) plot(post$posterior$beta) plot(x[,1], y) apply(post$posterior$beta, 1, function(b) lines(x[,1], cbind(1, x) %*% b, col = "#00990030"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.