Description Usage Arguments Value Examples
Bimodal Gumbel: Maximum Likelihood Estimation
1 | mlebgumbel(data, theta, auto = TRUE)
|
data |
A numeric vector. |
theta |
Vector. Starting parameter values for the minimization. Default: theta = c(1, 1, 1) |
auto |
Logical. Automatic search for theta initial condition. Default: TRUE |
List.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | # Let's generate some values
set.seed(123)
x <- rbgumbel(1000, mu = -2, sigma = 1, delta = -1)
# Look for these references in the figure:
hist(x, probability = TRUE)
lines(density(x), col = 'blue')
abline(v = c(-2.5, -.5), col = 'red')
text(x = c(c(-2.5, -.5)), y = c(.05, .05), c('mu\nnear here', 'delta\nnear here'))
# Time to fit!
# If argument auto = FALSE
fit <- mlebgumbel(
data = x,
# try some values near the region. Format: theta = c(mu, sigma, delta)
theta = c(-3, 2, -2),
auto = FALSE
)
print(fit)
# If argument auto = TRUE
fit <- mlebgumbel(
data = x,
auto = TRUE
)
print(fit)
# Kolmogorov-Smirnov Tests
mu.sigma.delta <- fit$estimate$estimate
ks.test(
x,
y = 'pbgumbel',
mu = mu.sigma.delta[[1]],
sigma = mu.sigma.delta[[2]],
delta = mu.sigma.delta[[3]]
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.