# Generalized Exponential Distribution
pdf_ge <- function(x, alpha, lambda) {
alpha * lambda * (1 - exp(-lambda * x))^(alpha - 1) * exp(-lambda * x)
}
cdf_ge <- function(x, alpha, lambda) {
(1 - exp(-lambda * x))^alpha
}
dist_moments(pdf_ge, cdf_ge, support = c(0, Inf), params = list(alpha = 2, lambda = 3))
# Exponentiated Weibull Distribution
pdf_expweibull <- function(x, a, b, c){
a * b * c * exp(-(b*x)^c) * (b*x)^(c-1) * (1 - exp(-(b*x)^c))^(a-1)
}
cdf_expweibull <- function(x, a, b, c){
(1 - exp(-(b*x)^c))^a
}
dist_moments(pdf_expweibull, cdf_expweibull, support = c(0, Inf),
params = list(a = 1.0, b = 1.4, c = 2.3))
Run the code above in your browser using DataLab