sd_ratio {bayesplay}R Documentation

Compute the Savage-Dickey density ratio

Description

Computes the Saveage-Dickey density ratio from a posterior object at a specified point

Usage

sd_ratio(x, point)

Arguments

x

a posterior object

point

the point at which to evaluate the Savage-Dickey ratio

Value

A numeric of the Savage-Dickey density ratio

Examples

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

[Package bayesplay version 0.9.3 Index]