dFG | R Documentation |
The Flexible Gumbel Distribution
dFG(x, w, loc, sigma1, sigma2)
rFG(n, w, loc, sigma1, sigma2)
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. |
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.
dFG
gives the density. rFG
generates random deviates.
liu2022bayesianGUD
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.