Learn R Programming

gestate (version 1.3.2)

MixExp: Mixture Exponential Curve constructor function

Description

This creates a Curve object for a Mixture Exponential distribution, commonly used for modelling distributions with subpopulations. Curve objects contain all necessary information to describe a distribution, including functions and parameters describing it. Parameterisation follows that used by pexp etc. See Details for more information on parameterisation.

Usage

MixExp(props, lambdas)

Arguments

props

Vector of length x for the probabilities of the subpopulations. Must sum to 1.

lambdas

Vector of length x for the rate parameters for the corresponding subpopulations define by props.

Details

The mixture distribution with rates lambda1 to lambda2 etc and prevalence p1 and p2 etc has parameterisation: f(x) = p1 lambda1 e^(- lambda1 x) + p2 lambda2 e^(- lambda2 x)+... F(x) = p1 (1 - e^(- lambda1 x)) + p2 (1 - e^(- lambda2 x))+...

Examples

Run this code
# NOT RUN {
MixExp(props=c(0.8,0.2),lambdas=c(0.01,0.1))
# }

Run the code above in your browser using DataLab