View source: R/helper_functions.R
sd_ratio | R Documentation |
Computes the Saveage-Dickey density ratio from a posterior
object
at a specified point
sd_ratio(x, point)
x |
a |
point |
the point at which to evaluate the Savage-Dickey ratio |
A numeric of the Savage-Dickey density ratio
# define a likelihood
data_model <- likelihood(family = "normal", mean = 5.5, sd = 32.35)
# define a prior
prior_model <- prior(family = "normal", mean = 5.5, sd = 13.3)
model <- extract_posterior(data_model * prior_model)
# compute the Savage-Dickey density ratio at 0
sd_ratio(model, 0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.