Closed spsanderson closed 11 months ago
Possible:
burr_stats <- function(alpha, beta, gamma, delta) {
# Args:
# alpha: The shape parameter of the Burr distribution.
# beta: The scale parameter of the Burr distribution.
# gamma: The location parameter of the Burr distribution.
# delta: The threshold parameter of the Burr distribution.
# Returns:
# A list containing the mean, median, mode, variance, skewness, and kurtosis of the Burr distribution.
mean <- gamma + beta * (alpha / (alpha + 1))
median <- gamma + beta * (log(2) / alpha) ** (1 / alpha)
mode <- gamma + beta * (1 / alpha) ** (1 / alpha)
variance <- beta ** 2 * (alpha * pi ** 2 / (6 * (alpha + 1) ** 2))
skewness <- (4 * sqrt(6) * (alpha + 1) * (alpha + 2)) / (alpha * pi ** (3 / 2) * (alpha + 3))
kurtosis <- 3 * (alpha ** 2 + 6 * alpha + 5) / (alpha * (alpha + 1) ** 2)
return(list(mean = mean, median = median, mode = mode, variance = variance, skewness = skewness, kurtosis = kurtosis))
}
library(TidyDensity)
x <- tidy_burr()$y
p <- util_burr_param_estimate(x)$parameter_tbl
s1 <- p$shape1
s2 <- p$shape2
r <- p$rate
sc <- 1/r
mu <- s2 + sc * (s1 / (s1 + 1))
mn <- (2 * (1/s1) - 1)^(1/s2)
md <- ((s2 - 1)/((s1*s2) + 1))^(1/s2)
va <- -1 * mu
sk <- (4 * sqrt(6) * (s1 + 2)) / (s1 * pi ^ (3/2)*(s1 + 3))
ku <- 3 * (s1^2 + 6 * s1 + 5) / (s1 * (s1 + 1)^2)
Documentation: https://en.wikipedia.org/wiki/Burr_distribution https://www.causascientia.org/math_stat/Dists/Compendium.pdf https://en.wikipedia.org/wiki/Beta_function#Software_implementation
Example: