integral: Compute integral

View source: R/helper_functions.R

integralR Documentation

Compute integral

Description

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

Usage

integral(obj)

Arguments

obj

a product object

Value

A numeric of the marginal likelihood

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)

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

# take the integral
integral(model)

bayesplay documentation built on April 14, 2023, 12:30 a.m.