
Last chance! 50% off unlimited learning
Sale ends in
Probability functions associated to the mixture of two exponential distributions.
dmixexp2(x, prob1,
rate1 = 1.0, rate2 = rate1 + delta, delta,
log = FALSE)
pmixexp2(q, prob1,
rate1 = 1.0, rate2 = rate1 + delta, delta,
log = FALSE)
qmixexp2(p, prob1,
rate1 = 1.0, rate2 = rate1 + delta, delta)
rmixexp2(n, prob1,
rate1 = 1.0, rate2 = rate1 + delta, delta)
hmixexp2(x, prob1,
rate1 = 1.0, rate2 = rate1 + delta, delta)
Hmixexp2(x, prob1,
rate1 = 1.0, rate2 = rate1 + delta, delta)
dmiwexp2
, pmiwexp2
, qmiwexp2
, evaluates the
density, the distribution and the quantile functions. dmixexp2
generates a vector of n
random draws from the distribution.
hmixep2
gives hazard rate and Hmixexp2
gives cumulative
hazard.
Vector of quantiles.
Vector of probabilities.
Number of observations.
Logical; if TRUE
, the log density is returned.
Probability weight for the "number 1" exponential density.
Rate (inverse expectation) for the "number 1" exponential density.
Rate (inverse expectation) for the "number 2" exponential
density. Should in most cases be > rate1
. See Details.
Alternative parameterisation delta = rate2 - rate1
.
The density function is the mixture of two exponential densities
prob1
while rate1
and rate2
.
A 'naive' identifiability constraint is rate1 < rate2
, corresponding to the simple constraint
delta > 0
. The parameter delta
can be given instead of
rate2
.
The mixture distribution has a decreasing hazard, increasing Mean Residual Life (MRL) and has a thicker tail than the usual exponential. However the hazard, MRL have a finite non zero limit and the distribution behaves as an exponential for large return levels/periods.
The quantile function is not available in closed form and is computed using a dedicated numerical method.
rate1 <- 1.0
rate2 <- 4.0
prob1 <- 0.8
qs <- qmixexp2(p = c(0.99, 0.999), prob1 = prob1,
rate1 = rate1, rate2 = rate2)
x <- seq(from = 0, to = qs[2], length.out = 200)
F <- pmixexp2(x, prob1 = prob1, rate1 = rate1, rate2 = rate2)
plot(x, F, type = "l", col = "orangered", lwd = 2,
main = "Mixexp2 distribution and quantile for p = 0.99")
abline(v = qs[1])
abline(h = 0.99)
Run the code above in your browser using DataLab