library(ggthemes)
library(ggplot2)
library(actuar)
##
## Attaching package: 'actuar'
## The following object is masked from 'package:grDevices':
##
## cm
dtrgamma(x, shape1, shape2, rate = 1, scale = 1/rate, log = FALSE)
\[f_X(x|\alpha,\tau,\theta) = \frac{\tau u^{\alpha}e^{-u}}{x\Gamma(\alpha)},\ u = (x/\theta)^{\tau}\]
\(x>0\), \(\alpha,\tau,\theta\in\mathbb{R}_+\)
shape1 = \(\alpha\)shape2 = \(\tau\)scale = \(\theta\)La Gamma transformada es la distribución de la variable aleatoria \(\theta X^{1/\tau}\), donde \(X\) tiene distribución Gamma con parámetro de forma \(\alpha\) y parámetro de escala de 1. Equivalentemente, de la variable aleatoria \(Y^{1/tau}\) con \(Y\) una variable aleatoria con distribución Gamma con parámetro de forma \(\alpha\) y parámetro de escala \(\theta^{\theta}\).
ggplot(data.frame(x = c(0, 4.5)), aes(x = x)) +
stat_function(fun = dtrgamma, args = list(2,3,1),
aes(colour = "alpha=2, tau=3 ,theta=1")) +
stat_function(fun = dtrgamma, args = list(1.5,4,2),
aes(colour = "alpha=1.5, tau=4 ,theta=2")) +
stat_function(fun = dtrgamma, args = list(3.25,1.5,2),
aes(colour = "alpha=3.25, tau=1.5 ,theta=2")) +
stat_function(fun = dtrgamma, args = list(1,2.25,5),
aes(colour = "alpha=1, tau=1 ,theta=5")) +
ggtitle("curves of probabilities") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
\[f_X(x|\mu,\sigma ) = \frac{1}{x\sigma \sqrt{2\pi}}\exp[\frac{-(ln(x)-\mu)^2}{2\sigma ^2}], x>0.\]
\[\mu \in \mathbb{R} (scale), \sigma>0 (sape)\]
Si \(x\sim N(\mu,\sigma)\), entonces \(\exp{x}\sim lognormal(\mu,\sigma)\)
ggplot(data.frame(x = c(0, 4.5)), aes(x = x)) +
stat_function(fun = dlnorm, args = list(0, 0.25),
aes(colour = "mu = 0, sigma = .25")) +
stat_function(fun = dlnorm, args = list(0, .5),
aes(colour = "mu = 0, sigma = 0.5")) +
stat_function(fun = dlnorm, args = list(0, 1),
aes(colour = "mu = 0, sigma = 1")) +
stat_function(fun = dlnorm, args = list(.5, 0.5),
aes(colour = "mu = 0.5, sigma = 0.5")) +
ggtitle("curves of probabilities") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
Esta es un caso particular de la distribución Beta Transformada con \(\tau = 1\)
\[f_X(x|\alpha,\gamma,\theta)=\frac{\alpha\gamma(x/\theta)^{\gamma}}{x[1+(x/\theta)^{\gamma}]^{\alpha+1}}, x>0\] con \(\alpha,\gamma,\theta\in\mathbb{R}_+\).
ggplot(data.frame(x = c(0, 4.5)), aes(x = x)) +
stat_function(fun = dburr, args = list(1,2,3),
aes(colour = "alpha=1, gamma=2 ,theta=3")) +
stat_function(fun = dburr, args = list(2,3,1),
aes(colour = "alpha=2, gamma=3 ,theta=1")) +
stat_function(fun = dburr, args = list(0.25,1,2),
aes(colour = "alpha=.25, gamma=1 ,theta=2")) +
stat_function(fun = dburr, args = list(1,1.25,1.5),
aes(colour = "alpha=1, gamma=1.25 ,theta=1.5")) +
ggtitle("curves of probabilities") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
Esta es un caso particular de la distribución Beta Transformada con \(\alpha = 1\).
\[f_X(x|\gamma,\tau,\theta)=\frac{\tau\gamma(x/\theta)^{\gamma\tau}}{x[1+(x/\theta)^{\gamma}]^{\tau+1}}, x>0\]
con \(\gamma,\tau,\theta\in\mathbb{R}_+\).
ggplot(data.frame(x = c(0, 4.5)), aes(x = x)) +
stat_function(fun = dinvburr, args = list(2,3,1),
aes(colour = "alpha=2, gamma=3 ,theta=1")) +
stat_function(fun = dinvburr, args = list(1.5,2.75,2),
aes(colour = "alpha=1.5, gamma=2.75 ,theta=2")) +
stat_function(fun = dinvburr, args = list(3.25,1.5,2),
aes(colour = "alpha=3.25, gamma=1.5 ,theta=2")) +
stat_function(fun = dinvburr, args = list(1,2.25,3.5),
aes(colour = "alpha=1, gamma=2.25 ,theta=3.5")) +
ggtitle("curves of probabilities") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
Esta es un caso particular de la distribución Beta Transformada con \(\tau = 1\) y \(\alpha = \gamma\).
\[f_X(x|\alpha,\theta)=\frac{\alpha^2(x/\theta)^{\alpha}}{x[1+(x/\theta)^{\alpha}]^{\alpha+1}}, x>0\]
ggplot(data.frame(x = c(0, 2.5)), aes(x = x)) +
stat_function(fun = dtrbeta,
args = list(shape1 = 1.3, shape2 = 1.3,
shape3 = 1, scale = 3),
aes(colour = "alpha = 1.3, gamma = 1.3, tau = 1, theta = 3")) +
stat_function(fun = dtrbeta,
args = list(shape1 = 2, shape2 = 2,
shape3 = 1, scale = 1/5),
aes(colour = "alpha = 2, gamma = 2, tau = 1, theta = 1/5")) +
stat_function(fun = dtrbeta,
args = list(shape1 = 3, shape2 = 3,
shape3 = 1, scale = 1/6),
aes(colour = "alpha = 3, gamma = 3, tau = 1, theta = 1/6")) +
stat_function(fun = dtrbeta,
args = list(shape1 = 0.4, shape2 = 0.4,
shape3 = 1, scale = 1/4),
aes(colour = "alpha = 0.4, gamma = 0.4, tau = 1, theta = 1/4")) +
ggtitle("Función de densidad") +
#scale_colour_brewer(palette="Set2") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
Esta es un caso particular de la distribución Beta Transformada con \(\alpha = 1\) y \(\gamma = \tau\).
\[f_X(x|\tau,\theta)=\frac{\tau^2(x/\theta)^{\tau^2}}{x[1+(x/\theta)^{\tau}]^{1+\tau}}, x>0\]
ggplot(data.frame(x = c(0, 2.5)), aes(x = x)) +
stat_function(fun = dtrbeta,
args = list(shape1 = 1, shape2 = 2,
shape3 = 2, scale = 1),
aes(colour = "alpha = 1, gamma = 2, tau = 2, theta = 1")) +
stat_function(fun = dtrbeta,
args = list(shape1 = 1, shape2 = 2,
shape3 = 2, scale = 1/5),
aes(colour = "alpha = 1, gamma = 2, tau = 2, theta = 1/5")) +
stat_function(fun = dtrbeta,
args = list(shape1 = 1, shape2 = 3,
shape3 = 3, scale = 1/6),
aes(colour = "alpha = 1, gamma = 3, tau = 3, theta = 1/6")) +
stat_function(fun = dtrbeta,
args = list(shape1 = 1, shape2 = 0.5,
shape3 = 0.5, scale = 4),
aes(colour = "alpha = 1, gamma = 0.5, tau = 0.5, theta = 4")) +
ggtitle("Función de densidad") +
#scale_colour_brewer(palette="Set2") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
## Pareto
Esta es un caso particular de la distribución Beta Transformada con \(\gamma = \tau = 1\).
\[f_X(x|\alpha,\theta)=\frac{\alpha(x/\theta)}{x[1+(x/\theta)]^{\alpha+1}}, x>0\]
ggplot(data.frame(x = c(0, 4.5)), aes(x = x)) +
stat_function(fun = dpareto, args = list(2,1),
aes(colour = "alpha=2, theta=1")) +
stat_function(fun = dpareto, args = list(1.5,2),
aes(colour = "alpha=1.5, theta=2")) +
stat_function(fun = dpareto, args = list(3.25,2),
aes(colour = "alpha=3.25, theta=2")) +
stat_function(fun = dpareto, args = list(1,3.5),
aes(colour = "alpha=1, theta=3.5")) +
ggtitle("curves of probabilities") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
Esta es un caso particular de la distribución Beta Transformada con \(\gamma = 1\).
\[f_X(x|\alpha,\tau,\theta)=\frac{\Gamma(\alpha+\tau)}{\Gamma(\alpha)\Gamma(\tau)}\frac{(x/\theta)^{\tau}}{x[1+(x/\theta)]^{\alpha+\tau}}, x>0\]
ggplot(data.frame(x = c(0, 4.5)), aes(x = x)) +
stat_function(fun = dgenpareto, args = list(2,3,1),
aes(colour = "alpha=2, tau=3 ,theta=1")) +
stat_function(fun = dgenpareto, args = list(1.5,2.75,2),
aes(colour = "alpha=1.5, tau=2.75 ,theta=2")) +
stat_function(fun = dgenpareto, args = list(3.25,1.5,2),
aes(colour = "alpha=3.25, tau=1.5 ,theta=2")) +
stat_function(fun = dgenpareto, args = list(1,2.25,3.5),
aes(colour = "alpha=1, tau=2.25 ,theta=3.5")) +
ggtitle("curves of probabilities") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")
Esta es un caso particular de la distribución Beta Transformada con \(\alpha = \gamma = 1\).
\[f_X(x|\tau,\theta)=\frac{\tau(x/\theta)^{\tau}}{x[1+(x/\theta)]^{\tau+1}}, x>0\]
ggplot(data.frame(x = c(0, 4.5)), aes(x = x)) +
stat_function(fun = dinvpareto, args = list(2,1),
aes(colour = "tau=2, theta=1")) +
stat_function(fun = dinvpareto, args = list(1.5,2),
aes(colour = "tau=1.5, theta=2")) +
stat_function(fun = dinvpareto, args = list(3.25,2),
aes(colour = "tau=3.25, theta=2")) +
stat_function(fun = dinvpareto, args = list(1,3.5),
aes(colour = "tau=1, theta=3.5")) +
ggtitle("curves of probabilities") +
labs(colour = "Groups") + theme_few() + scale_fill_few("Light")