knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

iNZightBayes

R-CMD-check Codecov test coverage

The goal of iNZightBayes is to ...

Installation

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")

Example

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"))


iNZightVIT/iNZightBayes documentation built on Dec. 20, 2021, 5:56 p.m.