mixtureBeta: Calculate parameters of a composite beta distribution arising...

Description Usage Arguments Details Value Examples

View source: R/mixtureBeta.R

Description

Assuming n beta distributions, each with parameters a and b, this routine computes the A and B of an overall beta distribution when the n distributions are mixed. Mixing parameters (fractions) can be specified as weights.

Usage

1
mixtureBeta(Ba, Bb, w = NULL)

Arguments

Ba

A vector containing the alpha parameter for all beta distributions.

Bb

A vector containing the beta parameter for all beta distributions.

w

A vector indicating the relative weight for each beta distribution in the mixture distribution. The default is NULL, in which case weights are all equal.

Details

The assumption is that each beta distribution is independent of every other, and that they are combined into a composite mixture beta distribution. This routine uses mixture distribution theory to calculate a mean and a variance. The mean and variance are then used in a method of moments approach to calculate the parameters for the composite beta distribution.

Value

A data frame (containing 1 row) with the beta mixture parameter estimates and summary statistics. The compoents (columns) of the returned data frame are:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## alpha parameter for the beta distribution
(alpha <- c(100.5,100.5,100.5,235.4,235.4))
## beta parameter for the beta distribution
(beta <- c(234.5,234.5,234.5,2708,2708))
## alpha and beta are assumed to be in the same order

mixtureBeta(Ba=alpha,Bb=beta) ## equal weights

weight <- 1:5

mixtureBeta(Ba=alpha,Bb=beta,w=weight) ## unequal weights

tmcd82070/evoab documentation built on May 13, 2020, 11:25 p.m.