Computes the Saveage-Dickey density ratio from a posterior
object
at a specified point
sd_ratio(x, point)
a posterior
object
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)
#> 0.9383493