Type: Package
Title: The Marshal–Olkin Generalized Inverse Weibull Distribution
Version: 0.1.0
Maintainer: Atchanut Rattanalertnusorn <atchanut_r@rmutt.ac.th>
Description: Density, distribution function, quantile function, and random generation function based on Salem, H. M. (2019)<doi:10.5539/mas.v13n2p54>. In addition, a numerical method for maximum likelihood estimation is provided.
License: GPL-3
Language: en-US
Encoding: UTF-8
RoxygenNote: 7.3.2
Imports: stats
Suggests: testthat (≥ 3.0.0)
NeedsCompilation: no
Packaged: 2025-09-04 08:02:00 UTC; User
Author: Atchanut Rattanalertnusorn [aut, cre]
Repository: CRAN
Date/Publication: 2025-09-09 14:10:07 UTC

Marshall–Olkin Generalized Inverse Weibull Distribution (MOGIW)

Description

Density, distribution function, quantile function, and random generation function for the MOGIW distribution with four parameters (alpha, beta, lambda, and beta). See details in references (Salem, 2019).

Usage

dMOGIW(x, alpha, beta, lambda, theta, log = FALSE)

pMOGIW(q, alpha, beta, lambda, theta, lower.tail = TRUE, log.p = FALSE)

qMOGIW(p, alpha, beta, lambda, theta, lower.tail = TRUE, log.q = FALSE)

rMOGIW(n, alpha, beta, lambda, theta)

Arguments

x, q

vector of quantile.

alpha

scale parameter of the Generalized Inverse Weibull Distribution (GIW), where \alpha > 0.

beta

shape parameter#1 of the Generalized Inverse Weibull Distribution (GIW), where \beta > 0.

lambda

shape parameter#2 of the Generalized Inverse Weibull Distribution (GIW), where \lambda > 0.

theta

Marshall–Olkin parameter, where \theta > 0.

log, log.p, log.q

logical; (default = FALSE), if TRUE, then probabilities are given as log(p) or log(q).

lower.tail

logical; if TRUE (default), probabilities are P[X \le x], otherwise, P[X > x].

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Value

dMOGIW gives the density, pMOGIW gives the distribution function, qMOGIW gives the quantile function and rMOGIW generates random samples.

References

Salem, H. M. (2019). The Marshall–Olkin Generalized Inverse Weibull Distribution: Properties and Application. Modern Applied Science, 13(2), 54. doi:10.5539/mas.v13n2p54

Examples

x <- seq(0.5,4,by=0.1)
dMOGIW(x,1,3,2,3)
p<- pMOGIW(q=x,1,3,2,3)
q<- qMOGIW(p,1,3,2,3)
q
rMOGIW(10,1,3,2,3)

x <- seq(0.5,4,by=0.1)
dMOGIW(x,1,3,2,3)          #or dMOGIW(x,alpha=1,beta=3,lambda=2,theta=3)
dMOGIW(x,1,3,2,3,log=TRUE) #or dMOGIW(x,alpha=1,beta=3,lambda=2,theta=3,log=TRUE)

q <- seq(1,4,by=0.1)
pMOGIW(q,1,3,2,3)   #or  pMOGIW(q,1,3,2,3,lower.tail = TRUE)
pMOGIW(q,1,3,2,3,lower.tail = FALSE)

q <- seq(0.5,1.5,by=0.01)
p <- pMOGIW(q,1,3,2,3)
x <- qMOGIW(p,1,3,2,3)

x <- rMOGIW(10,1,3,2,3)
x


Numerical method for maximum likelihood estimation

Description

In maximum likelihood estimation, if the Hessian matrix is difficult to obtain, Numerical method (means an iteration optimization method) will be used to obtain the model parameter.

Usage

mleMOGIW(x, param, method = "L-BFGS-B")

Arguments

x

vector of data.

param

inintial four parameters (alpha, beta, lambda, and beta)

method

a numerical method for maximum likelihood estimation, a default method is "L-BFGS-B", the other specify "BFGS"

Value

outout is a list of variables as follows: est_param gives the estimated four parameters, neg_likelihood gives the negative-log-likelihood value, code_conversgence is code of convergence, if 0, convergence , otherwise, divergence. num_method is numerical method, a default method is "L-BFGS-B"

References

Zhu, C., Byrd, R. H., Lu, P., & Nocedal, J. (1997). Algorithm 778: L-BFGS-B. ACM Transactions on Mathematical Software, 23(4), 550–560. https://doi.org/10.1145/279232.279236.

Examples

y <- rMOGIW(100,1,3,2,3)
pars <- c(alpha=1, beta=3, lambda=2, theta=3)
mleMOGIW(x=y,param=pars,method = "L-BFGS-B")