Learn R Programming

cobin (version 1.0.1.3)

dmicobin: Density function of micobin (mixture of continuous binomial) distribution

Description

Micobin distribution with natural parameter \(\theta\) and dispersion \(psi\), denoted as \(micobin(\theta, \psi)\), is defined as a dispersion mixture of cobin: $$ Y \sim micobin(\theta, \psi) \iff Y | \lambda \sim cobin(\theta, \lambda^{-1}), (\lambda-1) \sim negbin(2, \psi) $$ so that micobin density is a weighted sum of cobin density with negative binomial weights.

Usage

dmicobin(x, theta, psi, r = 2, log = FALSE, l_max = 70)

Value

density of \(micobin(\theta, \psi)\)

Arguments

x

num (length n), between 0 and 1, evaluation point

theta

scalar or length n vector, natural parameter

psi

scalar or length n vector, between 0 and 1, dispersion parameter

r

(Default 2) This should be always 2 to maintain interpretaton of psi. It is kept for future experiment purposes.

log

logical (Default FALSE), if TRUE, return log density

l_max

integer (Default 70), upper bound of lambda.

Examples

Run this code
hist(rcobin(1000, 2, 3), freq = FALSE)
xgrid = seq(0, 1, length = 500)
lines(xgrid, dcobin(xgrid, 2, 3))

Run the code above in your browser using DataLab