Learn R Programming

bayesCureRateModel (version 1.5)

log_gamma_mixture: PDF and CDF of a Gamma mixture distribution

Description

Computes the logarithm of the probability density function and cumulative density function per observation for each observation under a Gamma mixture model.

Usage

log_gamma_mixture(y, a1, a2, p, c_under = 1e-09)

Value

A list containing the following entries

log_f

natural logarithm of the pdf, evaluated at each datapoint.

log_F

natural logarithm of the CDF, evaluated at each datapoint.

Arguments

y

observed data

a1

vector containing the shape parameters of each Gamma mixture component

a2

vector containing the rate parameters of each Gamma mixture component

p

vector of mixing proportions

c_under

threshold for underflows.

Author

Panagiotis Papastamoulis

Examples

Run this code
y <- runif(10)
a1 <- c(1,2)
a2 <- c(1,1)
p <- c(0.9,0.1)
log_gamma_mixture(y, a1, a2, p)

Run the code above in your browser using DataLab