mlebgumbel {bgumbel}R Documentation

Bimodal Gumbel: Maximum Likelihood Estimation

Description

Bimodal Gumbel: Maximum Likelihood Estimation

Usage

mlebgumbel(data, theta, auto = TRUE)

Arguments

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

Value

List.

Examples

# 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]]
)


[Package bgumbel version 0.0.3 Index]