dFG {GUD} | R Documentation |
The Flexible Gumbel Distribution
Description
The Flexible Gumbel Distribution
Usage
dFG(x, w, loc, sigma1, sigma2)
rFG(n, w, loc, sigma1, sigma2)
Arguments
x |
vector of quantiles. |
w |
vector of weight parameters. |
loc |
vector of the location parameters. |
sigma1 |
vector of the scale parameters of the left skewed part. |
sigma2 |
vector of the scale parameters of the right skewed part. |
n |
number of observations. |
Details
The Gumbel distribution has the density
f_{\text {Gumbel }}(y \mid \theta, \sigma)=\frac{1}{\sigma} \exp \left\{-\frac{y-\theta}{\sigma}-\exp \left(-\frac{y-\theta}{\sigma}\right)\right\},
where \theta \in \mathbb{R}
is the mode as the location parameter, \sigma > 0
is the scale parameter.
The flexible Gumbel distribution has the density
f_{\mathrm{FG}}\left(y \mid w, \theta, \sigma_1, \sigma_2\right)=w f_{\text {Gumbel }}\left(-y \mid-\theta, \sigma_1\right)+(1-w) f_{\text {Gumbel }}\left(y \mid \theta, \sigma_2\right) .
where w \in [0,1]
is the weight parameter, \sigma_{1} > 0
is the scale parameter of the left skewed part and \sigma_{2} > 0
is the scale parameter of the right skewed part.
Value
dFG
gives the density. rFG
generates random deviates.
References
Liu Q, Huang X, Bai R (2024). “Bayesian Modal Regression Based on Mixture Distributions.” Computational Statistics & Data Analysis, 108012. doi:10.1016/j.csda.2024.108012.
Examples
set.seed(100)
require(graphics)
# Random Number Generation
X <- rFG(n = 1e5, w = 0.3, loc = 0, sigma1 = 1, sigma2 = 2)
# Plot the histogram
hist(X, breaks = 100, freq = FALSE)
# The red dashed line should match the underlining histogram
points(x = seq(-10,20,length.out = 1000),
y = dFG(x = seq(-10,20,length.out = 1000),
w = 0.3, loc = 0, sigma1 = 1, sigma2 = 2),
type = "l",
col = "red",
lwd = 3,
lty = 2)