The visualizeBF
package is useful for teaching about Bayes Factors, providing two different visual interpretations of the concept.
This is mostly a toy package useful for teaching.
You need the devtools
package to install this from github.
install.packages("devtools")
Then install visualizeBF
.
devtools::install_github("mcbeem/visualizeBF")
And then load it.
library(visualizeBF)
library(visualizeBF)
First, simulate some data.
set.seed(1) data <- rnorm(n=50, mean=.3, sd=1)
Visualize the BF as the ratio of the weighted average likelihood under $H_1$ to the likelihood of the data under $H_0$ (via plot=1
).
visualizeBF(data, plot=1)
Visualize the BF as the ratio of prior to posterior density under $H_0$ (via plot=2
).
visualizeBF(data, plot=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.