integral: Compute integral

Description Usage Arguments Value Examples

View source: R/helper_functions.R

Description

Computes the definite integral of a product object over the range of the parameter

Usage

1
integral(obj)

Arguments

obj

a product object

Value

A numeric of the marginal likelihood

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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)

# multiply the likelihood by the prior
model <- data_model * prior_model

# take the integral
integral(model)

bayesplay documentation built on Sept. 9, 2021, 9:09 a.m.