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
where is the mode as the location parameter,
is the scale parameter.
The flexible Gumbel distribution has the density
where is the weight parameter,
is the scale parameter of the left skewed part and
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)