fun_integ: Calculate the integrand for the marginal distribution of X...

Description Usage Arguments Value Examples

Description

The (posterior) marginal distribution of X equals the integral of the conditional distribution of X given theta, uniform over [-theta, theta], weighted by the (posterior) distribution of theta, a mixture of Gammas. The function fun_integ explicitly computes the integrand as a function of theta.

Usage

1
fun_integ(x, pi, shape, rate)

Arguments

x

a number (vector) specifies the value of the domain argument.

pi

a vector containing the component probabilities of the Gammas

shape,

rate numeric vectors corresponding to shape and rate parameters of Gammas

Value

The (posterior) marginal distribution of X (over theta) at the input parameter x.

Examples

1
2
3
4
5
6
7
pi <- c(0.2,0.5,0.3)
shape <- c(2.3,3.3,4.3) 
rate <- c(1.5,2.5,3.5)
theta <- 0.1 
fun_integ(theta, pi, shape, rate)
theta <- c(0.1,0.5,3)
fun_integ(theta, pi, shape, rate)

tamustatsy/bcdd documentation built on May 7, 2019, 9:39 a.m.