Description Usage Arguments Value Examples
Define a likelihood
1 | define(x, likelihood)
|
x |
A |
likelihood |
A formula where the right hand side is a variable in
|
A data.frame
with the likelihood as an attribute.
1 2 3 4 5 6 7 8 9 | my_lik <- function(data, theta) {dnorm(data, mean = 3.07333 , sd = theta)}
my_prior <- function(theta) {dgamma(theta, shape = 1)}
posterior <- define(iris, Sepal.Width ~ my_lik) %>%
assume(prior = ~ my_prior) %>%
draw(initial = .43, nbatch = 1e5, blen = 1, scale = .01) %>%
diagnose() %>%
clean(burnin = 0, subsample = 40) %>%
diagnose()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.