| Title: | Estimation for some Reliability Distributions |
|---|---|
| Description: | Parameters estimation and linear regression models for Reliability distributions families reviewed by Almalki & Nadarajah (2014) <doi:10.1016/j.ress.2013.11.010> using Generalized Additive Models for Location, Scale and Shape, GAMLSS by Rigby & Stasinopoulos (2005) <doi:10.1111/j.1467-9876.2005.00510.x>. |
| Authors: | Freddy Hernandez-Barajas [aut, cre] (ORCID: <https://orcid.org/0000-0001-7459-3329>), Olga Usuga [aut] (ORCID: <https://orcid.org/0000-0003-3062-1820>), Carmen Patino [aut], Jaime Mosquera [aut] (ORCID: <https://orcid.org/0000-0002-1684-4756>) |
| Maintainer: | Freddy Hernandez-Barajas <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.1 |
| Built: | 2026-06-01 16:58:44 UTC |
| Source: | https://github.com/fhernanb/reldists |
The Additive Weibull distribution
AddW(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")AddW(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
tau.link |
defines the tau.link, with "log" link as the default for the tau parameter. |
Additive Weibull distribution with parameters mu,
sigma, nu and tau has density given by
for .
Returns a gamlss.family object which can be used to fit a
AddW distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J. (2018). A reduced new modified Weibull distribution. Communications in Statistics-Theory and Methods, 47(10), 2297-2313.
Xie, M., & Lai, C. D. (1996). Reliability analysis using an additive Weibull model with bathtub-shaped failure rate function. Reliability Engineering & System Safety, 52(1), 87-93.
# Example 1 # Generating some random values with # known mu, sigma, nu and tau # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: y <- rAddW(n=100, mu=1.5, sigma=0.2, nu=3, tau=0.8) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family='AddW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) ## End(Not run) # Example 2 # Generating random values under some model # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1.67 + -3 * x1) sigma <- exp(0.69 - 2 * x2) nu <- 3 tau <- 0.8 x <- rAddW(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=AddW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau")) ## End(Not run)# Example 1 # Generating some random values with # known mu, sigma, nu and tau # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: y <- rAddW(n=100, mu=1.5, sigma=0.2, nu=3, tau=0.8) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family='AddW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) ## End(Not run) # Example 2 # Generating random values under some model # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1.67 + -3 * x1) sigma <- exp(0.69 - 2 * x2) nu <- 3 tau <- 0.8 x <- rAddW(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=AddW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau")) ## End(Not run)
The Beta Generalized Exponentiated family
BGE(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")BGE(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
tau.link |
defines the tau.link, with "log" link as the default for the tau parameter. |
The Beta Generalized Exponentiated distribution with parameters mu,
sigma, nu and tau has density given by
for , , , and .
Returns a gamlss.family object which can be used to fit a BGE distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J. (2018). A reduced new modified Weibull distribution. Communications in Statistics-Theory and Methods, 47(10), 2297-2313.
Barreto-Souza, W., Santos, A. H., & Cordeiro, G. M. (2010). The beta generalized exponential distribution. Journal of statistical Computation and Simulation, 80(2), 159-172.
# Generating some random values with # known mu, sigma, nu and tau y <- rBGE(n=100, mu = 1.5, sigma =1.7, nu=1, tau=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=BGE, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.5 - x1) sigma <- exp(0.8 - x2) nu <- 1 tau <- 1 x <- rBGE(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=BGE, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))# Generating some random values with # known mu, sigma, nu and tau y <- rBGE(n=100, mu = 1.5, sigma =1.7, nu=1, tau=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=BGE, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.5 - x1) sigma <- exp(0.8 - x2) nu <- 1 tau <- 1 x <- rBGE(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=BGE, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))
The function BS() defines The Birnbaum-Saunders,
a two parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting
using the function gamlss().
BS(mu.link = "log", sigma.link = "log")BS(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization is the median of ,
and
. The functions
proposed here
corresponds to the functions created by Roquim et al. (2021)
with minor modifications to obtain correct log-likelihoods
and random samples.
Returns a gamlss.family object which can be used to fit a BS distribution in the gamlss() function.
Birnbaum, Z.W. and Saunders, S.C. (1969a). A new family of life distributions. J. Appl. Prob., 6, 319–327.
Roquim, F. V., Ramires, T. G., Nakamura, L. R., Righetto, A. J., Lima, R. R., & Gomes, R. A. (2021). Building flexible regression models: including the Birnbaum-Saunders distribution in the gamlss package. Semina: Ciencias Exatas e Tecnologicas, 42(2), 163-168.
# Example 1 # Generating some random values with # known mu and sigma y <- rBS(n=100, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y as BS gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rBS(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=300) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS, data=dat) summary(mod2) # Example 3 # Fatigue life (T) measures in cycles (×10-3) of n 101 # aluminum coupons (specimens) of type 6061-T6. # Taken from Leiva et al. (2006) page 37. # https://journal.r-project.org/articles/RN-2006-033/RN-2006-033.pdf y <- c(70, 90, 96, 97, 99, 100, 103, 104, 104, 105, 107, 108, 108, 108, 109, 109, 112, 112, 113, 114, 114, 114, 116, 119, 120, 120, 120, 121, 121, 123, 124, 124, 124, 124, 124, 128, 128, 129, 129, 130, 130, 130, 131, 131, 131, 131, 131, 132, 132, 132, 133, 134, 134, 134, 134, 134, 136, 136, 137, 138, 138, 138, 139, 139, 141, 141, 142, 142, 142, 142, 142, 142, 144, 144, 145, 146, 148, 148, 149, 151, 151, 152, 155, 156, 157, 157, 157, 157, 158, 159, 162, 163, 163, 164, 166, 166, 168, 170, 174, 196, 212) mod3 <- gamlss(y~1, sigma.fo=~1, family=BS) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Example 4 # Aggregate payments by the insurer # in thousand Skr (Swedish currency). # Taken from Balakrishnan and Kundu (2019) page 65. # https://onlinelibrary.wiley.com/doi/abs/10.1002/asmb.2348 y <- c(5014, 5855, 6486, 6540, 6656, 6656, 7212, 7541, 7558, 7797, 8546, 9345, 11762, 12478, 13624, 14451, 14940, 14963, 15092, 16203, 16229, 16730, 18027, 18343, 19365, 21782, 24248, 29069, 34267, 38993) y <- y/10000 mod4 <- gamlss(y~1, sigma.fo=~1, family=BS) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma"))# Example 1 # Generating some random values with # known mu and sigma y <- rBS(n=100, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y as BS gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rBS(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=300) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS, data=dat) summary(mod2) # Example 3 # Fatigue life (T) measures in cycles (×10-3) of n 101 # aluminum coupons (specimens) of type 6061-T6. # Taken from Leiva et al. (2006) page 37. # https://journal.r-project.org/articles/RN-2006-033/RN-2006-033.pdf y <- c(70, 90, 96, 97, 99, 100, 103, 104, 104, 105, 107, 108, 108, 108, 109, 109, 112, 112, 113, 114, 114, 114, 116, 119, 120, 120, 120, 121, 121, 123, 124, 124, 124, 124, 124, 128, 128, 129, 129, 130, 130, 130, 131, 131, 131, 131, 131, 132, 132, 132, 133, 134, 134, 134, 134, 134, 136, 136, 137, 138, 138, 138, 139, 139, 141, 141, 142, 142, 142, 142, 142, 142, 144, 144, 145, 146, 148, 148, 149, 151, 151, 152, 155, 156, 157, 157, 157, 157, 158, 159, 162, 163, 163, 164, 166, 166, 168, 170, 174, 196, 212) mod3 <- gamlss(y~1, sigma.fo=~1, family=BS) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Example 4 # Aggregate payments by the insurer # in thousand Skr (Swedish currency). # Taken from Balakrishnan and Kundu (2019) page 65. # https://onlinelibrary.wiley.com/doi/abs/10.1002/asmb.2348 y <- c(5014, 5855, 6486, 6540, 6656, 6656, 7212, 7541, 7558, 7797, 8546, 9345, 11762, 12478, 13624, 14451, 14940, 14963, 15092, 16203, 16229, 16730, 18027, 18343, 19365, 21782, 24248, 29069, 34267, 38993) y <- y/10000 mod4 <- gamlss(y~1, sigma.fo=~1, family=BS) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma"))
The function BS10() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS10(mu.link = "log", sigma.link = "log")BS10(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default
for the mu parameter (representing |
sigma.link |
defines the sigma.link, with "log" link as the default
for the sigma parameter (representing |
The Birnbaum-Saunders distribution with parameters mu and sigma
(where mu represents and sigma represents )
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS10 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
# Example 1 # Generating some random values with # known mu and sigma set.seed(12345) y <- rBS10(n=100, mu=0.75, sigma=5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS10) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS10 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1.6 * x1) # Aprox 0.75 sigma <- exp(2.2 - 1.2 * x2) # Aprox 5 y <- rBS10(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS10, data=dat) summary(mod2)# Example 1 # Generating some random values with # known mu and sigma set.seed(12345) y <- rBS10(n=100, mu=0.75, sigma=5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS10) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS10 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1.6 * x1) # Aprox 0.75 sigma <- exp(2.2 - 1.2 * x2) # Aprox 5 y <- rBS10(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS10, data=dat) summary(mod2)
The function BS11() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS11(mu.link = "log", sigma.link = "log")BS11(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default
for the mu parameter (representing |
sigma.link |
defines the sigma.link, with "log" link as the default
for the sigma parameter (representing |
The Birnbaum-Saunders distribution with parameters mu and sigma
(where mu represents and sigma represents )
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS11 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
# Example 1 # Generating some random values with # known mu and sigma set.seed(1234) y <- rBS11(n=100, mu=1, sigma=12) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS11) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS11 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1 * x1) # Aprox 1 sigma <- exp(1.9 + 1.2 * x2) # Aprox 12 y <- rBS11(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS11, data=dat) summary(mod2)# Example 1 # Generating some random values with # known mu and sigma set.seed(1234) y <- rBS11(n=100, mu=1, sigma=12) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS11) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS11 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1 * x1) # Aprox 1 sigma <- exp(1.9 + 1.2 * x2) # Aprox 12 y <- rBS11(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS11, data=dat) summary(mod2)
The function BS12() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS12(mu.link = "log", sigma.link = "log")BS12(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default
for the mu parameter (representing the scale |
sigma.link |
defines the sigma.link, with "log" link as the default
for the sigma parameter (representing the shape |
The Birnbaum-Saunders distribution with parameters mu and sigma
(where mu represents and sigma represents )
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS12 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
# Example 1 # Generating some random values with # known mu and sigma set.seed(12345) y <- rBS12(n=100, mu=1, sigma=30) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS12) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS12 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1 * x1) # Aprox 1 sigma <- exp(2.2 + 2.4 * x2) # Aprox 30 y <- rBS12(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS12, data=dat) summary(mod2)# Example 1 # Generating some random values with # known mu and sigma set.seed(12345) y <- rBS12(n=100, mu=1, sigma=30) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS12) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS12 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1 * x1) # Aprox 1 sigma <- exp(2.2 + 2.4 * x2) # Aprox 30 y <- rBS12(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS12, data=dat) summary(mod2)
The function BS13() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS13(mu.link = "log", sigma.link = "log")BS13(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default
for the mu parameter (representing the scale |
sigma.link |
defines the sigma.link, with "log" link as the default
for the sigma parameter (representing the shape |
The Birnbaum-Saunders distribution with parameters mu and sigma
(where mu represents and sigma represents )
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS13 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
# Example 1 # Generating some random values with # known mu and sigma set.seed(123456) y <- rBS13(n=500, mu=5, sigma=30) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS13, control=gamlss.control(n.cyc=300, trace=TRUE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS13 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.1 + 1.1 * x1) # Aprox 5 sigma <- exp(2.2 + 2.4 * x2) # Aprox 30 y <- rBS13(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS13, data=dat, control=gamlss.control(n.cyc=500, trace=TRUE)) summary(mod2)# Example 1 # Generating some random values with # known mu and sigma set.seed(123456) y <- rBS13(n=500, mu=5, sigma=30) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS13, control=gamlss.control(n.cyc=300, trace=TRUE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS13 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.1 + 1.1 * x1) # Aprox 5 sigma <- exp(2.2 + 2.4 * x2) # Aprox 30 y <- rBS13(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS13, data=dat, control=gamlss.control(n.cyc=500, trace=TRUE)) summary(mod2)
The function BS2() defines The Birnbaum-Saunders,
a two parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting
using the function gamlss().
BS2(mu.link = "log", sigma.link = "log")BS2(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization
and
.
Returns a gamlss.family object which can be used to fit a
BS2 distribution in the gamlss() function.
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Barros, M. (2014). A reparameterized Birnbaum–Saunders distribution and its moments, estimation and applications. REVSTAT-Statistical Journal, 12(3), 247-272.
dBS2.
# Example 1 # Generating some random values with # known mu and sigma y <- rBS2(n=50, mu=5, sigma=3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS2 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rBS2(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS2, data=dat) summary(mod2) # Example 3 # Household expenditures for food in the United States (US) expressed # in thousands of US dollars (M$) # Santos-Neto et al. (2014) page 266. y <- c(15.998, 16.652, 21.741, 7.431, 10.481, 13.548, 23.256, 17.976, 14.161, 8.825, 14.184, 19.604, 13.728, 21.141, 17.446, 9.629, 14.005, 9.160, 18.831, 7.641, 13.882, 9.670, 21.604, 10.866, 28.980, 10.882, 18.561, 11.629, 18.067, 14.539, 19.192, 25.918, 28.833, 15.869, 14.910, 9.550, 23.066, 14.751) mod3 <- gamlss(y~1, sigma.fo=~1, family=BS2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Example 4 # lifetimes of 6061-T6 aluminum coupons expressed in cycles (×10-3) # at a maximum stress level of 3.1 psi (×104), until the failure to occur. # Santos-Neto et al. (2014) page 267. y <- c(70, 90, 96, 97, 99, 100, 103, 104, 104, 105, 107, 108, 108, 108, 109, 109, 112, 112, 113, 114, 114, 114, 116, 119, 120, 120, 120, 121, 121, 123, 124, 124, 124, 124, 124, 128, 128, 129, 129, 130, 130, 130, 131, 131, 131, 131, 131, 132, 132, 132, 133, 134, 134, 134, 134, 134, 136, 136, 137, 138, 138, 138, 139, 139, 141, 141, 142, 142, 142, 142, 142, 142, 144, 144, 145, 146, 148, 148, 149, 151, 151, 152, 155, 156, 157, 157, 157, 157, 158, 159, 162, 163, 163, 164, 166, 166, 168, 170, 174, 196, 212) mod4 <- gamlss(y~1, sigma.fo=~1, family=BS2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma"))# Example 1 # Generating some random values with # known mu and sigma y <- rBS2(n=50, mu=5, sigma=3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS2 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rBS2(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS2, data=dat) summary(mod2) # Example 3 # Household expenditures for food in the United States (US) expressed # in thousands of US dollars (M$) # Santos-Neto et al. (2014) page 266. y <- c(15.998, 16.652, 21.741, 7.431, 10.481, 13.548, 23.256, 17.976, 14.161, 8.825, 14.184, 19.604, 13.728, 21.141, 17.446, 9.629, 14.005, 9.160, 18.831, 7.641, 13.882, 9.670, 21.604, 10.866, 28.980, 10.882, 18.561, 11.629, 18.067, 14.539, 19.192, 25.918, 28.833, 15.869, 14.910, 9.550, 23.066, 14.751) mod3 <- gamlss(y~1, sigma.fo=~1, family=BS2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Example 4 # lifetimes of 6061-T6 aluminum coupons expressed in cycles (×10-3) # at a maximum stress level of 3.1 psi (×104), until the failure to occur. # Santos-Neto et al. (2014) page 267. y <- c(70, 90, 96, 97, 99, 100, 103, 104, 104, 105, 107, 108, 108, 108, 109, 109, 112, 112, 113, 114, 114, 114, 116, 119, 120, 120, 120, 121, 121, 123, 124, 124, 124, 124, 124, 128, 128, 129, 129, 130, 130, 130, 131, 131, 131, 131, 131, 132, 132, 132, 133, 134, 134, 134, 134, 134, 136, 136, 137, 138, 138, 138, 139, 139, 141, 141, 142, 142, 142, 142, 142, 142, 144, 144, 145, 146, 148, 148, 149, 151, 151, 152, 155, 156, 157, 157, 157, 157, 158, 159, 162, 163, 163, 164, 166, 166, 168, 170, 174, 196, 212) mod4 <- gamlss(y~1, sigma.fo=~1, family=BS2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma"))
The function BS3() defines The Birnbaum-Saunders,
a two parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting
using the function gamlss().
BS3(mu.link = "log", sigma.link = "logit")BS3(mu.link = "log", sigma.link = "logit")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "logit" link as the default for the sigma. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization
and
.
Returns a gamlss.family object which can be used to fit a
BS3 distribution in the gamlss() function.
Bourguignon, M., & Gallardo, D. I. (2022). A new look at the Birnbaum–Saunders regression model. Applied Stochastic Models in Business and Industry, 38(6), 935-951.
dBS3.
# Example 1 # Generating some random values with # known mu and sigma y <- rBS3(n=50, mu=2, sigma=0.2) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS3) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS3 ## Not run: gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) inv_logit <- function(x) 1 / (1 + exp(-x)) sigma <- inv_logit(2 - 1.5 * x2) y <- rBS3(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS3, data=dat, control=gamlss.control(n.cyc=100)) summary(mod2) ## End(Not run) # Example 3 # The response variable is the ratio between the average # rent per acre planted with alfalfa and the corresponding # average rent for other agricultural uses. The density of # dairy cows (X2, number per square mile) is the explanatory variable. library(alr4) data("landrent") landrent$ratio <- landrent$Y / landrent$X1 with(landrent, plot(x=X2, y=ratio)) mod3 <- gamlss(ratio~X2, sigma.fo=~X2, data=landrent, family=BS3) summary(mod3) logLik(mod3)# Example 1 # Generating some random values with # known mu and sigma y <- rBS3(n=50, mu=2, sigma=0.2) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS3) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS3 ## Not run: gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) inv_logit <- function(x) 1 / (1 + exp(-x)) sigma <- inv_logit(2 - 1.5 * x2) y <- rBS3(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS3, data=dat, control=gamlss.control(n.cyc=100)) summary(mod2) ## End(Not run) # Example 3 # The response variable is the ratio between the average # rent per acre planted with alfalfa and the corresponding # average rent for other agricultural uses. The density of # dairy cows (X2, number per square mile) is the explanatory variable. library(alr4) data("landrent") landrent$ratio <- landrent$Y / landrent$X1 with(landrent, plot(x=X2, y=ratio)) mod3 <- gamlss(ratio~X2, sigma.fo=~X2, data=landrent, family=BS3) summary(mod3) logLik(mod3)
The function BS4() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS4(mu.link = "log", sigma.link = "log")BS4(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma parameter. |
The Birnbaum-Saunders distribution with parameters mu and sigma
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS4 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Ahmed, S. E., Budsaba, K., Lisawadi, S., & Volodin, A. (2008). Parametric estimation for the Birnbaum-Saunders lifetime distribution based on a new parametrization. Thailand Statistician, 6(2), 213-240.
dBS4.
# Example 1 # Generating some random values with # known mu and sigma set.seed(123) y <- rBS4(n=50, mu=2, sigma=0.2) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS4) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS4 ## Not run: gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rBS4(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS4, data=dat, control=gamlss.control(n.cyc=100)) summary(mod2) ## End(Not run) # Example 3 # Taken from Ahmed et al. (2008) on page 227 # The response variable is the fatigue # life of 6061-T6 aluminum coupons. ## Not run: y <- c( 70, 90, 96, 97, 99, 100, 103, 104, 104, 105, 107, 108, 108, 108, 109, 109, 112, 112, 113, 114, 114, 114, 116, 119, 120, 120, 120, 121, 121, 123, 124, 124, 124, 124, 124, 128, 128, 129, 130, 130, 130, 130, 131, 131, 131, 131, 131, 132, 132, 132, 133, 134, 134, 134, 134, 134, 136, 136, 137, 138, 138, 138, 139, 139, 141, 141, 142, 142, 142, 142, 142, 142, 144, 144, 145, 146, 148, 148, 149, 151, 151, 152, 155, 156, 157, 157, 157, 157, 158, 159, 162, 163, 163, 164, 166, 166, 168, 170, 174, 196, 212 ) mod3 <- gamlss(y~1, family=BS4, control=gamlss.control(n.cyc=3000)) summary(mod3) exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) plot(density(y)) curve(dBS4(x, mu=0.5145121, sigma=67.81761), add=TRUE, col="tomato", lwd=2) legend("topright", legend=c("Empirical", "Estimated"), col=c("black", "tomato"), lty=1) ## End(Not run) # Example 4 # Taken from Ahmed et al. (2008) on page 228 # The response variable is the fatigue life in # hours of 10 bearings of a certain type. ## Not run: y <- c(152.7, 172.0, 172.5, 173.5, 193.0, 204.7, 216.5, 234.9, 262.6, 422.6) mod4 <- gamlss(y~1, family=BS4, control=gamlss.control(n.cyc=3000)) summary(mod4) exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma")) ## End(Not run)# Example 1 # Generating some random values with # known mu and sigma set.seed(123) y <- rBS4(n=50, mu=2, sigma=0.2) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS4) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS4 ## Not run: gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rBS4(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS4, data=dat, control=gamlss.control(n.cyc=100)) summary(mod2) ## End(Not run) # Example 3 # Taken from Ahmed et al. (2008) on page 227 # The response variable is the fatigue # life of 6061-T6 aluminum coupons. ## Not run: y <- c( 70, 90, 96, 97, 99, 100, 103, 104, 104, 105, 107, 108, 108, 108, 109, 109, 112, 112, 113, 114, 114, 114, 116, 119, 120, 120, 120, 121, 121, 123, 124, 124, 124, 124, 124, 128, 128, 129, 130, 130, 130, 130, 131, 131, 131, 131, 131, 132, 132, 132, 133, 134, 134, 134, 134, 134, 136, 136, 137, 138, 138, 138, 139, 139, 141, 141, 142, 142, 142, 142, 142, 142, 144, 144, 145, 146, 148, 148, 149, 151, 151, 152, 155, 156, 157, 157, 157, 157, 158, 159, 162, 163, 163, 164, 166, 166, 168, 170, 174, 196, 212 ) mod3 <- gamlss(y~1, family=BS4, control=gamlss.control(n.cyc=3000)) summary(mod3) exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) plot(density(y)) curve(dBS4(x, mu=0.5145121, sigma=67.81761), add=TRUE, col="tomato", lwd=2) legend("topright", legend=c("Empirical", "Estimated"), col=c("black", "tomato"), lty=1) ## End(Not run) # Example 4 # Taken from Ahmed et al. (2008) on page 228 # The response variable is the fatigue life in # hours of 10 bearings of a certain type. ## Not run: y <- c(152.7, 172.0, 172.5, 173.5, 193.0, 204.7, 216.5, 234.9, 262.6, 422.6) mod4 <- gamlss(y~1, family=BS4, control=gamlss.control(n.cyc=3000)) summary(mod4) exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma")) ## End(Not run)
The function BS5() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS5(mu.link = "log", sigma.link = "log")BS5(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma parameter. |
The Birnbaum-Saunders distribution with parameters mu and sigma
(where sigma represents the precision parameter )
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS5 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
dBS5.
# Example 1 # Generating some random values with # known mu and sigma set.seed(123) y <- rBS5(n=50, mu=1, sigma=25) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS5) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS5 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.5 - 3 * x1) # Aprox 1 sigma <- exp(2.4 + 1.7 * x2) # Aprox 25 y <- rBS5(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS5, data=dat) summary(mod2)# Example 1 # Generating some random values with # known mu and sigma set.seed(123) y <- rBS5(n=50, mu=1, sigma=25) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS5) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS5 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.5 - 3 * x1) # Aprox 1 sigma <- exp(2.4 + 1.7 * x2) # Aprox 25 y <- rBS5(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS5, data=dat) summary(mod2)
The function BS6() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS6(mu.link = "log", sigma.link = "log")BS6(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma parameter. |
The Birnbaum-Saunders distribution with parameters mu and sigma
(where mu represents the true mean and sigma represents the shape parameter )
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS6 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
dBS6.
# Example 1 # Generating some random values with # known mu and sigma set.seed(1234) y <- rBS6(n=50, mu=1, sigma=0.1) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS6) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS6 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.5 - 3 * x1) # Aprox 1 sigma <- exp(0.5 - 3.5 * x2) # Aprox 0.1 y <- rBS6(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS6, data=dat) summary(mod2)# Example 1 # Generating some random values with # known mu and sigma set.seed(1234) y <- rBS6(n=50, mu=1, sigma=0.1) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS6) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS6 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.5 - 3 * x1) # Aprox 1 sigma <- exp(0.5 - 3.5 * x2) # Aprox 0.1 y <- rBS6(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS6, data=dat) summary(mod2)
The function BS7() defines the Birnbaum-Saunders distribution,
a two-parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting using the function gamlss().
BS7(mu.link = "log", sigma.link = "log")BS7(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter (representing the variance). |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma parameter (representing the shape). |
The Birnbaum-Saunders distribution with parameters mu and sigma
(where mu represents the true variance and sigma represents the shape parameter )
has density given by
for , and . In this parameterization,
and
.
Returns a gamlss.family object which can be used to fit a
BS7 distribution in the gamlss() function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
dBS7.
# Example 1 # Generating some random values with # known mu and sigma set.seed(12345) y <- rBS7(n=100, mu=0.2, sigma=10) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS7, control=gamlss.control(n.cyc=1000)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS7 ## Not run: gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.6 - 4.4 * x1) # Aprox 0.2 sigma <- exp(1.6 + 1.5 * x2) # Aprox 10 y <- rBS7(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS7, data=dat, control=gamlss.control(n.cyc=1000)) summary(mod2) ## End(Not run)# Example 1 # Generating some random values with # known mu and sigma set.seed(12345) y <- rBS7(n=100, mu=0.2, sigma=10) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=BS7, control=gamlss.control(n.cyc=1000)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ BS7 ## Not run: gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.6 - 4.4 * x1) # Aprox 0.2 sigma <- exp(1.6 + 1.5 * x2) # Aprox 10 y <- rBS7(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=BS7, data=dat, control=gamlss.control(n.cyc=1000)) summary(mod2) ## End(Not run)
The function CJ2() defines The two-parameter Chris-Jerry distribution,
a two parameter distribution, for a gamlss.family object to be used
in GAMLSS fitting using the function gamlss().
CJ2(mu.link = "log", sigma.link = "log")CJ2(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The two-parameter Chris-Jerry distribution with parameters mu and sigma
has density given by
Note: In this implementation we changed the original parameters for
and for we did it to implement this distribution
within gamlss framework.
Returns a gamlss.family object which can be used to fit a CJ2 distribution in the gamlss() function.
Manuel Gutierrez Tangarife, [email protected]
Chinedu, Eberechukwu Q., et al. "New lifetime distribution with applications to single acceptance sampling plan and scenarios of increasing hazard rates" Symmetry 15.10 (2023): 188.
# Example 1 # Generating some random values with # known mu and sigma y <- rCJ2(n=500, mu=1, sigma=1.5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=CJ2, control=gamlss.control(n.cyc=5000, trace=TRUE)) # Extracting the fitted values for mu, sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values under some model gendat <- function(n) { x1 <- runif(n, min=0, max=5) x2 <- runif(n, min=0, max=5) mu <- exp(-0.2 + 1.5 * x1) sigma <- exp(1 - 0.7 * x2) y <- rCJ2(n=n, mu, sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) datos <- gendat(n=500) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=CJ2, data=datos, control=gamlss.control(n.cyc=5000, trace=TRUE)) summary(mod2)# Example 1 # Generating some random values with # known mu and sigma y <- rCJ2(n=500, mu=1, sigma=1.5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=CJ2, control=gamlss.control(n.cyc=5000, trace=TRUE)) # Extracting the fitted values for mu, sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values under some model gendat <- function(n) { x1 <- runif(n, min=0, max=5) x2 <- runif(n, min=0, max=5) mu <- exp(-0.2 + 1.5 * x1) sigma <- exp(1 - 0.7 * x2) y <- rCJ2(n=n, mu, sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) datos <- gendat(n=500) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=CJ2, data=datos, control=gamlss.control(n.cyc=5000, trace=TRUE)) summary(mod2)
The Cosine Sine Exponential family
CS2e(mu.link = "log", sigma.link = "log", nu.link = "log")CS2e(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Cosine Sine Exponential distribution with parameters mu,
sigma and nu has density given by
for , , and .
Returns a gamlss.family object which can be used to fit a CS2e distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Chesneau, C., Bakouch, H. S., & Hussain, T. (2019). A new class of probability distributions via cosine and sine functions with applications. Communications in Statistics-Simulation and Computation, 48(8), 2287-2300.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rCS2e(n=100, mu = 0.1, sigma =1, nu=0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='CS2e', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.45, max=0.55) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.2 - x1) sigma <- exp(0.8 - x2) nu <- 0.5 x <- rCS2e(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1,family=CS2e, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rCS2e(n=100, mu = 0.1, sigma =1, nu=0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='CS2e', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.45, max=0.55) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.2 - x1) sigma <- exp(0.8 - x2) nu <- 0.5 x <- rCS2e(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1,family=CS2e, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
Density, distribution function, quantile function,
random generation and hazard function for the Additive Weibull distribution
with parameters mu, sigma, nu and tau.
dAddW(x, mu, sigma, nu, tau, log = FALSE) pAddW(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qAddW(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rAddW(n, mu, sigma, nu, tau) hAddW(x, mu, sigma, nu, tau)dAddW(x, mu, sigma, nu, tau, log = FALSE) pAddW(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qAddW(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rAddW(n, mu, sigma, nu, tau) hAddW(x, mu, sigma, nu, tau)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
shape parameter. |
tau |
shape parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
Additive Weibull Distribution with parameters mu,
sigma, nu and tau has density given by
for .
dAddW gives the density, pAddW gives the distribution
function, qAddW gives the quantile function, rAddW
generates random deviates and hAddW gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Xie, M., & Lai, C. D. (1996). Reliability analysis using an additive Weibull model with bathtub-shaped failure rate function. Reliability Engineering & System Safety, 52(1), 87-93.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dAddW(x, mu=1.5, sigma=0.5, nu=3, tau=0.8), from=0.0001, to=2, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pAddW(x, mu=1.5, sigma=0.5, nu=3, tau=0.8), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pAddW(x, mu=1.5, sigma=0.5, nu=3, tau=0.8, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qAddW(p, mu=1.5, sigma=0.2, nu=3, tau=0.8), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pAddW(x, mu=1.5, sigma=0.2, nu=3, tau=0.8), from=0, add=TRUE, col="red") ## The random function hist(rAddW(n=10000, mu=1.5, sigma=0.2, nu=3, tau=0.8), freq=FALSE, xlab="x", las=1, main="") curve(dAddW(x, mu=1.5, sigma=0.2, nu=3, tau=0.8), from=0.09, to=5, add=TRUE, col="red") ## The Hazard function curve(hAddW(x, mu=1.5, sigma=0.2, nu=3, tau=0.8), from=0.001, to=1, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dAddW(x, mu=1.5, sigma=0.5, nu=3, tau=0.8), from=0.0001, to=2, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pAddW(x, mu=1.5, sigma=0.5, nu=3, tau=0.8), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pAddW(x, mu=1.5, sigma=0.5, nu=3, tau=0.8, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qAddW(p, mu=1.5, sigma=0.2, nu=3, tau=0.8), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pAddW(x, mu=1.5, sigma=0.2, nu=3, tau=0.8), from=0, add=TRUE, col="red") ## The random function hist(rAddW(n=10000, mu=1.5, sigma=0.2, nu=3, tau=0.8), freq=FALSE, xlab="x", las=1, main="") curve(dAddW(x, mu=1.5, sigma=0.2, nu=3, tau=0.8), from=0.09, to=5, add=TRUE, col="red") ## The Hazard function curve(hAddW(x, mu=1.5, sigma=0.2, nu=3, tau=0.8), from=0.001, to=1, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Beta Generalized Exponentiated distribution
with parameters mu, sigma, nu and tau.
dBGE(x, mu, sigma, nu, tau, log = FALSE) pBGE(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qBGE(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rBGE(n, mu, sigma, nu, tau) hBGE(x, mu, sigma, nu, tau)dBGE(x, mu, sigma, nu, tau, log = FALSE) pBGE(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qBGE(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rBGE(n, mu, sigma, nu, tau) hBGE(x, mu, sigma, nu, tau)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
tau |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Beta Generalized Exponentiated Distribution with parameters mu,
sigma, nu and tau has density given by
for , , , and .
dBGE gives the density, pBGE gives the distribution
function, qBGE gives the quantile function, rBGE
generates random deviates and hBGE gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Barreto-Souza, W., Santos, A. H., & Cordeiro, G. M. (2010). The beta generalized exponential distribution. Journal of statistical Computation and Simulation, 80(2), 159-172.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1), from = 0, to = 3, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qBGE(p = p, mu = 1.5, sigma =1.7, nu=1, tau=1), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pBGE(x, mu = (1/4), sigma =1, nu=1, tau=2), from = 0, add = TRUE, col = "red") ## The random function hist(rBGE(1000, mu = 1.5, sigma =1.7, nu=1, tau=1), freq = FALSE, xlab = "x", ylim = c(0, 1), las = 1, main = "") curve(dBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1), from = 0, add = TRUE, col = "red", ylim = c(0, 0.5)) ## The Hazard function( par(mfrow=c(1,1)) curve(hBGE(x, mu = 0.9, sigma =0.5, nu=1, tau=1), from = 0, to = 2, col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1), from = 0, to = 3, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qBGE(p = p, mu = 1.5, sigma =1.7, nu=1, tau=1), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pBGE(x, mu = (1/4), sigma =1, nu=1, tau=2), from = 0, add = TRUE, col = "red") ## The random function hist(rBGE(1000, mu = 1.5, sigma =1.7, nu=1, tau=1), freq = FALSE, xlab = "x", ylim = c(0, 1), las = 1, main = "") curve(dBGE(x, mu = 1.5, sigma =1.7, nu=1, tau=1), from = 0, add = TRUE, col = "red", ylim = c(0, 0.5)) ## The Hazard function( par(mfrow=c(1,1)) curve(hBGE(x, mu = 0.9, sigma =0.5, nu=1, tau=1), from = 0, to = 2, col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS(x, mu = 1, sigma = 1, log = FALSE) pBS(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) qBS(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) rBS(n, mu = 1, sigma = 1) hBS(x, mu, sigma)dBS(x, mu = 1, sigma = 1, log = FALSE) pBS(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) qBS(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) rBS(n, mu = 1, sigma = 1) hBS(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization is the median of ,
and
. The functions
proposed here
corresponds to the functions created by Roquim et al. (2021)
with minor modifications to obtain correct log-likelihoods
and random samples.
dBS gives the density, pBS gives the distribution
function, qBS gives the quantile function, rBS
generates random deviates and hBS gives the hazard function.
Birnbaum, Z.W. and Saunders, S.C. (1969a). A new family of life distributions. J. Appl. Prob., 6, 319–327.
Roquim, F. V., Ramires, T. G., Nakamura, L. R., Righetto, A. J., Lima, R. R., & Gomes, R. A. (2021). Building flexible regression models: including the Birnbaum-Saunders distribution in the gamlss package. Semina: Ciencias Exatas e Tecnologicas, 42(2), 163-168.
BS.
# Example 1 # Plotting the mass function for different parameter values curve(dBS(x, mu=0.5, sigma=0.5), from=0.001, to=5, ylim=c(0, 2), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(dBS(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dBS(x, mu=0.5, sigma=1), from=0.001, to=5, ylim=c(0, 1.5), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS(x, mu=1, sigma=1), col="tomato", lwd=2, add=TRUE) curve(dBS(x, mu=1.5, sigma=1), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1", "mu=1.0, sigma=1", "mu=1.5, sigma=1"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dBS(x, mu=0.5, sigma=1.5), from=0.001, to=8, ylim=c(0, 2), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS(x, mu=1, sigma=1.5), col="tomato", lwd=2, add=TRUE) curve(dBS(x, mu=1.5, sigma=1.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1.5", "mu=1.0, sigma=1.5", "mu=1.5, sigma=1.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS(x, mu=0.5, sigma=0.5), from=0.001, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(pBS(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) curve(pBS(x, mu=0.5, sigma=0.5, lower.tail=FALSE), from=0.001, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS(x, mu=1, sigma=0.5, lower.tail=FALSE), col="tomato", lwd=2, add=TRUE) curve(pBS(x, mu=1.5, sigma=0.5, lower.tail=FALSE), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS(x, mu=2.3, sigma=1.7), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS(n=10000, mu=20, sigma=0.5) hist(x, freq=FALSE) curve(dBS(x, mu=20, sigma=0.5), from=0, to=100, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS(x, mu=20, sigma=0.5), from=0.001, to=100, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS(x, mu=0.5, sigma=0.5), from=0.001, to=5, ylim=c(0, 2), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(dBS(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dBS(x, mu=0.5, sigma=1), from=0.001, to=5, ylim=c(0, 1.5), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS(x, mu=1, sigma=1), col="tomato", lwd=2, add=TRUE) curve(dBS(x, mu=1.5, sigma=1), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1", "mu=1.0, sigma=1", "mu=1.5, sigma=1"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dBS(x, mu=0.5, sigma=1.5), from=0.001, to=8, ylim=c(0, 2), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS(x, mu=1, sigma=1.5), col="tomato", lwd=2, add=TRUE) curve(dBS(x, mu=1.5, sigma=1.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1.5", "mu=1.0, sigma=1.5", "mu=1.5, sigma=1.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS(x, mu=0.5, sigma=0.5), from=0.001, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(pBS(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) curve(pBS(x, mu=0.5, sigma=0.5, lower.tail=FALSE), from=0.001, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS(x, mu=1, sigma=0.5, lower.tail=FALSE), col="tomato", lwd=2, add=TRUE) curve(pBS(x, mu=1.5, sigma=0.5, lower.tail=FALSE), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS(x, mu=2.3, sigma=1.7), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS(n=10000, mu=20, sigma=0.5) hist(x, freq=FALSE) curve(dBS(x, mu=20, sigma=0.5), from=0, to=100, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS(x, mu=20, sigma=0.5), from=0.001, to=100, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS10(x, mu = 1, sigma = 0.5, log = FALSE) pBS10(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS10(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS10(n, mu = 1, sigma = 0.5) hBS10(x, mu, sigma)dBS10(x, mu = 1, sigma = 0.5, log = FALSE) pBS10(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS10(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS10(n, mu = 1, sigma = 0.5) hBS10(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter representing |
sigma |
parameter representing |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this parameterization,
and
.
dBS10 gives the density, pBS10 gives the distribution
function, qBS10 gives the quantile function, rBS10
generates random deviates and hBS10 gives the hazard function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
BS10.
# Example 1 # Plotting the mass function for different parameter values curve(dBS10(x, mu=0.75, sigma=5), from=0.001, to=1.5, ylim=c(0, 6.2), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS10(x, mu=1.15, sigma=5), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.75, sigma=5", "mu=1.15, sigma=5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS10(x, mu=0.75, sigma=5), from=0.00001, to=1.5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS10(x, mu=1.15, sigma=5), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.75, sigma=5", "mu=1.15, sigma=5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS10(p, mu=0.75, sigma=5), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS10(x, mu=0.75, sigma=5), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS10(n=10000, mu=0.75, sigma=5) hist(x, freq=FALSE) curve(dBS10(x, mu=0.75, sigma=5), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS10(x, mu=0.75, sigma=5), from=0.001, to=2, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS10(x, mu=0.75, sigma=5), from=0.001, to=1.5, ylim=c(0, 6.2), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS10(x, mu=1.15, sigma=5), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.75, sigma=5", "mu=1.15, sigma=5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS10(x, mu=0.75, sigma=5), from=0.00001, to=1.5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS10(x, mu=1.15, sigma=5), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.75, sigma=5", "mu=1.15, sigma=5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS10(p, mu=0.75, sigma=5), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS10(x, mu=0.75, sigma=5), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS10(n=10000, mu=0.75, sigma=5) hist(x, freq=FALSE) curve(dBS10(x, mu=0.75, sigma=5), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS10(x, mu=0.75, sigma=5), from=0.001, to=2, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS11(x, mu = 1, sigma = 0.5, log = FALSE) pBS11(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS11(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS11(n, mu = 1, sigma = 0.5) hBS11(x, mu, sigma)dBS11(x, mu = 1, sigma = 0.5, log = FALSE) pBS11(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS11(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS11(n, mu = 1, sigma = 0.5) hBS11(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter representing |
sigma |
parameter representing |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this parameterization,
and
.
dBS11 gives the density, pBS11 gives the distribution
function, qBS11 gives the quantile function, rBS11
generates random deviates and hBS11 gives the hazard function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
BS11.
# Example 1 # Plotting the mass function for different parameter values curve(dBS11(x, mu=1, sigma=12), from=0.001, to=2.5, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS11(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=12", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS11(x, mu=1, sigma=12), from=0.00001, to=8, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS11(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=1, sigma=12", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS11(p, mu=1, sigma=12), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS11(x, mu=1, sigma=12), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS11(n=10000, mu=1, sigma=12) hist(x, freq=FALSE) curve(dBS11(x, mu=1, sigma=12), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS11(x, mu=1, sigma=12), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS11(x, mu=1, sigma=12), from=0.001, to=2.5, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS11(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=12", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS11(x, mu=1, sigma=12), from=0.00001, to=8, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS11(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=1, sigma=12", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS11(p, mu=1, sigma=12), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS11(x, mu=1, sigma=12), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS11(n=10000, mu=1, sigma=12) hist(x, freq=FALSE) curve(dBS11(x, mu=1, sigma=12), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS11(x, mu=1, sigma=12), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS12(x, mu = 1, sigma = 0.5, log = FALSE) pBS12(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS12(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS12(n, mu = 1, sigma = 0.5) hBS12(x, mu, sigma)dBS12(x, mu = 1, sigma = 0.5, log = FALSE) pBS12(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS12(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS12(n, mu = 1, sigma = 0.5) hBS12(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter representing |
sigma |
parameter representing |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this parameterization,
and
.
dBS12 gives the density, pBS12 gives the distribution
function, qBS12 gives the quantile function, rBS12
generates random deviates and hBS12 gives the hazard function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
BS12.
# Example 1 # Plotting the mass function for different parameter values curve(dBS12(x, mu=1, sigma=30), from=0.001, to=2.5, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS12(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=30", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS12(x, mu=1, sigma=30), from=0.00001, to=8, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS12(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=1, sigma=30", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS12(p, mu=1, sigma=30), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS12(x, mu=1, sigma=30), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS12(n=10000, mu=1, sigma=30) hist(x, freq=FALSE) curve(dBS12(x, mu=1, sigma=30), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS12(x, mu=1, sigma=30), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS12(x, mu=1, sigma=30), from=0.001, to=2.5, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS12(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=30", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS12(x, mu=1, sigma=30), from=0.00001, to=8, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS12(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=1, sigma=30", "mu=1, sigma=0.5"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS12(p, mu=1, sigma=30), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS12(x, mu=1, sigma=30), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS12(n=10000, mu=1, sigma=30) hist(x, freq=FALSE) curve(dBS12(x, mu=1, sigma=30), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS12(x, mu=1, sigma=30), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS13(x, mu = 1, sigma = 0.5, log = FALSE) pBS13(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS13(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS13(n, mu = 1, sigma = 0.5) hBS13(x, mu, sigma)dBS13(x, mu = 1, sigma = 0.5, log = FALSE) pBS13(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS13(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS13(n, mu = 1, sigma = 0.5) hBS13(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter representing |
sigma |
parameter representing |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this parameterization,
and
.
dBS13 gives the density, pBS13 gives the distribution
function, qBS13 gives the quantile function, rBS13
generates random deviates and hBS13 gives the hazard function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
BS13.
# Example 1 # Plotting the mass function for different parameter values curve(dBS13(x, mu=5, sigma=30), from=0.001, to=0.8, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS13(x, mu=5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=5, sigma=30", "mu=5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS13(x, mu=5, sigma=30), from=0.00001, to=2, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS13(x, mu=5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=5, sigma=30", "mu=5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS13(p, mu=5, sigma=30), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS13(x, mu=5, sigma=30), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS13(n=10000, mu=5, sigma=30) hist(x, freq=FALSE) curve(dBS13(x, mu=5, sigma=30), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS13(x, mu=5, sigma=30), from=0.001, to=1, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS13(x, mu=5, sigma=30), from=0.001, to=0.8, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS13(x, mu=5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=5, sigma=30", "mu=5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS13(x, mu=5, sigma=30), from=0.00001, to=2, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS13(x, mu=5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=5, sigma=30", "mu=5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS13(p, mu=5, sigma=30), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS13(x, mu=5, sigma=30), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS13(n=10000, mu=5, sigma=30) hist(x, freq=FALSE) curve(dBS13(x, mu=5, sigma=30), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS13(x, mu=5, sigma=30), from=0.001, to=1, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS2(x, mu = 1, sigma = 1, log = FALSE) pBS2(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) qBS2(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) rBS2(n, mu = 1, sigma = 1) hBS2(x, mu, sigma)dBS2(x, mu = 1, sigma = 1, log = FALSE) pBS2(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) qBS2(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) rBS2(n, mu = 1, sigma = 1) hBS2(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization
and
. The functions
proposed here corresponds to the
parameterization proposed by
Santos-Neto et al. (2014).
dBS2 gives the density, pBS2 gives the distribution
function, qBS2 gives the quantile function, rBS2
generates random deviates and hBS2 gives the hazard function.
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Barros, M. (2014). A reparameterized Birnbaum–Saunders distribution and its moments, estimation and applications. REVSTAT-Statistical Journal, 12(3), 247-272.
BS2.
#Example 1 #Plotting the mass function for different parameter values curve(dBS2(x, mu=1.0, sigma=100), from=0.001, to=5, ylim=c(0, 3), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS2(x, mu=1.5, sigma=100), col="tomato", lwd=2, add=TRUE) curve(dBS2(x, mu=2.0, sigma=100), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=1.0, sigma=100", "mu=1.5, sigma=100", "mu=2.0, sigma=100"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dBS2(x, mu=1, sigma=2), from=0.001, to=2, ylim=c(0, 1.1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS2(x, mu=1, sigma=5), col="tomato", lwd=2, add=TRUE) curve(dBS2(x, mu=1, sigma=10), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=2", "mu=1, sigma=5", "mu=1, sigma=10"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS2(x, mu=0.5, sigma=0.5), from=0.001, to=15, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS2(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(pBS2(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS2(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS2(x, mu=2.3, sigma=1.7), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS2(n=10000, mu=2.5, sigma=100) hist(x, freq=FALSE) curve(dBS2(x, mu=2.5, sigma=100), from=0, to=10, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS2(x, mu=20, sigma=0.5), from=0.001, to=100, col="tomato", ylab="Hazard function", las=1)#Example 1 #Plotting the mass function for different parameter values curve(dBS2(x, mu=1.0, sigma=100), from=0.001, to=5, ylim=c(0, 3), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS2(x, mu=1.5, sigma=100), col="tomato", lwd=2, add=TRUE) curve(dBS2(x, mu=2.0, sigma=100), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=1.0, sigma=100", "mu=1.5, sigma=100", "mu=2.0, sigma=100"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dBS2(x, mu=1, sigma=2), from=0.001, to=2, ylim=c(0, 1.1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS2(x, mu=1, sigma=5), col="tomato", lwd=2, add=TRUE) curve(dBS2(x, mu=1, sigma=10), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=2", "mu=1, sigma=5", "mu=1, sigma=10"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS2(x, mu=0.5, sigma=0.5), from=0.001, to=15, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS2(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(pBS2(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS2(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS2(x, mu=2.3, sigma=1.7), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS2(n=10000, mu=2.5, sigma=100) hist(x, freq=FALSE) curve(dBS2(x, mu=2.5, sigma=100), from=0, to=10, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS2(x, mu=20, sigma=0.5), from=0.001, to=100, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS3(x, mu = 1, sigma = 0.5, log = FALSE) pBS3(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS3(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS3(n, mu = 1, sigma = 0.5) hBS3(x, mu, sigma)dBS3(x, mu = 1, sigma = 0.5, log = FALSE) pBS3(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS3(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS3(n, mu = 1, sigma = 0.5) hBS3(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization
and
. The functions
proposed here corresponds to the
parameterization proposed by
Santos-Neto et al. (2014).
dBS3 gives the density, pBS3 gives the distribution
function, qBS3 gives the quantile function, rBS3
generates random deviates and hBS3 gives the hazard function.
Bourguignon, M., & Gallardo, D. I. (2022). A new look at the Birnbaum–Saunders regression model. Applied Stochastic Models in Business and Industry, 38(6), 935-951.
BS3.
# Example 1 # Plotting the mass function for different parameter values curve(dBS3(x, mu=2, sigma=0.2), from=0.001, to=10, ylim=c(0, 0.4), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS3(x, mu=2, sigma=0.4), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=2, sigma=0.2", "mu=2, sigma=0.4"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS3(x, mu=2, sigma=0.2), from=0.00001, to=10, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS3(x, mu=2, sigma=0.4), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2, sigma=0.2", "mu=2, sigma=0.4"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS3(p, mu=2, sigma=0.2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS3(x, mu=2, sigma=0.2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS3(n=10000, mu=2, sigma=0.2) hist(x, freq=FALSE) curve(dBS3(x, mu=2, sigma=0.2), from=0, to=10, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS3(x, mu=2, sigma=0.2), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS3(x, mu=2, sigma=0.2), from=0.001, to=10, ylim=c(0, 0.4), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS3(x, mu=2, sigma=0.4), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=2, sigma=0.2", "mu=2, sigma=0.4"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS3(x, mu=2, sigma=0.2), from=0.00001, to=10, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS3(x, mu=2, sigma=0.4), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2, sigma=0.2", "mu=2, sigma=0.4"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS3(p, mu=2, sigma=0.2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS3(x, mu=2, sigma=0.2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS3(n=10000, mu=2, sigma=0.2) hist(x, freq=FALSE) curve(dBS3(x, mu=2, sigma=0.2), from=0, to=10, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS3(x, mu=2, sigma=0.2), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS4(x, mu = 1, sigma = 0.5, log = FALSE) pBS4(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS4(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS4(n, mu = 1, sigma = 0.5) hBS4(x, mu, sigma)dBS4(x, mu = 1, sigma = 0.5, log = FALSE) pBS4(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS4(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS4(n, mu = 1, sigma = 0.5) hBS4(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter ( |
sigma |
parameter ( |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization
and
.
dBS4 gives the density, pBS4 gives the distribution
function, qBS4 gives the quantile function, rBS4
generates random deviates and hBS4 gives the hazard function.
David Villegas Ceballos, [email protected]
Ahmed, S. E., Budsaba, K., Lisawadi, S., & Volodin, A. (2008). Parametric estimation for the Birnbaum-Saunders lifetime distribution based on a new parametrization. Thailand Statistician, 6(2), 213-240.
BS4.
# Example 1 # Plotting the mass function for different parameter values curve(dBS4(x, mu=2, sigma=30), from=0.001, to=40, ylim=c(0, 0.20), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS4(x, mu=1, sigma=20), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=2, sigma=30", "mu=1, sigma=20"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS4(x, mu=2, sigma=30), from=0.00001, to=40, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS4(x, mu=1, sigma=20), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2, sigma=30", "mu=1, sigma=20"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS4(p, mu=2, sigma=30), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS4(x, mu=2, sigma=30), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS4(n=10000, mu=2, sigma=30) hist(x, freq=FALSE) curve(dBS4(x, mu=2, sigma=30), from=0, to=30, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS4(x, mu=2, sigma=30), from=0.001, to=40, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS4(x, mu=2, sigma=30), from=0.001, to=40, ylim=c(0, 0.20), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS4(x, mu=1, sigma=20), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=2, sigma=30", "mu=1, sigma=20"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS4(x, mu=2, sigma=30), from=0.00001, to=40, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS4(x, mu=1, sigma=20), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2, sigma=30", "mu=1, sigma=20"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS4(p, mu=2, sigma=30), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS4(x, mu=2, sigma=30), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS4(n=10000, mu=2, sigma=30) hist(x, freq=FALSE) curve(dBS4(x, mu=2, sigma=30), from=0, to=30, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS4(x, mu=2, sigma=30), from=0.001, to=40, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS5(x, mu = 1, sigma = 0.5, log = FALSE) pBS5(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS5(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS5(n, mu = 1, sigma = 0.5) hBS5(x, mu, sigma)dBS5(x, mu = 1, sigma = 0.5, log = FALSE) pBS5(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS5(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS5(n, mu = 1, sigma = 0.5) hBS5(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter ( |
sigma |
precision parameter |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this
parameterization
and
.
dBS5 gives the density, pBS5 gives the distribution
function, qBS5 gives the quantile function, rBS5
generates random deviates and hBS5 gives the hazard function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
BS5.
# Example 1 # Plotting the mass function for different parameter values curve(dBS5(x, mu=1, sigma=2), from=0.001, to=2, ylim=c(0, 1.5), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS5(x, mu=1, sigma=25), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=2", "mu=1, sigma=25"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS5(x, mu=1, sigma=2), from=0.00001, to=6, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS5(x, mu=1, sigma=25), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=1, sigma=2", "mu=1, sigma=25"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS5(p, mu=1, sigma=2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS5(x, mu=1, sigma=2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS5(n=10000, mu=1, sigma=25) hist(x, freq=FALSE) curve(dBS5(x, mu=1, sigma=25), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS5(x, mu=1, sigma=25), from=0.001, to=6, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS5(x, mu=1, sigma=2), from=0.001, to=2, ylim=c(0, 1.5), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS5(x, mu=1, sigma=25), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=1, sigma=2", "mu=1, sigma=25"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS5(x, mu=1, sigma=2), from=0.00001, to=6, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS5(x, mu=1, sigma=25), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=1, sigma=2", "mu=1, sigma=25"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS5(p, mu=1, sigma=2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS5(x, mu=1, sigma=2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS5(n=10000, mu=1, sigma=25) hist(x, freq=FALSE) curve(dBS5(x, mu=1, sigma=25), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS5(x, mu=1, sigma=25), from=0.001, to=6, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS6(x, mu = 1, sigma = 0.5, log = FALSE) pBS6(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS6(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS6(n, mu = 1, sigma = 0.5) hBS6(x, mu, sigma)dBS6(x, mu = 1, sigma = 0.5, log = FALSE) pBS6(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS6(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS6(n, mu = 1, sigma = 0.5) hBS6(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter representing the mean ( |
sigma |
parameter representing the shape |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this parameterization,
and
.
dBS6 gives the density, pBS6 gives the distribution
function, qBS6 gives the quantile function, rBS6
generates random deviates and hBS6 gives the hazard function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
BS6.
# Example 1 # Plotting the mass function for different parameter values curve(dBS6(x, mu=2, sigma=0.1), from=0.001, to=3, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS6(x, mu=2, sigma=0.75), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=2, sigma=0.1", "mu=2, sigma=0.75"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS6(x, mu=2, sigma=0.1), from=0.00001, to=6, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS6(x, mu=2, sigma=0.75), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2, sigma=0.1", "mu=2, sigma=0.75"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS6(p, mu=1, sigma=2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS6(x, mu=1, sigma=2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS6(n=10000, mu=2, sigma=0.1) hist(x, freq=FALSE) curve(dBS6(x, mu=2, sigma=0.1), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS6(x, mu=2, sigma=0.1), from=0.001, to=6, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS6(x, mu=2, sigma=0.1), from=0.001, to=3, col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS6(x, mu=2, sigma=0.75), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=2, sigma=0.1", "mu=2, sigma=0.75"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS6(x, mu=2, sigma=0.1), from=0.00001, to=6, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS6(x, mu=2, sigma=0.75), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2, sigma=0.1", "mu=2, sigma=0.75"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS6(p, mu=1, sigma=2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS6(x, mu=1, sigma=2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS6(n=10000, mu=2, sigma=0.1) hist(x, freq=FALSE) curve(dBS6(x, mu=2, sigma=0.1), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS6(x, mu=2, sigma=0.1), from=0.001, to=6, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the
Birnbaum-Saunders distribution with
parameters mu and sigma.
dBS7(x, mu = 0.5, sigma = 10, log = FALSE) pBS7(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS7(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS7(n, mu = 1, sigma = 0.5) hBS7(x, mu, sigma)dBS7(x, mu = 0.5, sigma = 10, log = FALSE) pBS7(q, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) qBS7(p, mu = 1, sigma = 0.5, lower.tail = TRUE, log.p = FALSE) rBS7(n, mu = 1, sigma = 0.5) hBS7(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter representing the shape ( |
sigma |
parameter representing the variance ( |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Birnbaum-Saunders with parameters mu and sigma
has density given by
for , and . In this parameterization,
and
.
dBS7 gives the density, pBS7 gives the distribution
function, qBS7 gives the quantile function, rBS7
generates random deviates and hBS7 gives the hazard function.
David Villegas Ceballos, [email protected]
Santos-Neto, M., Cysneiros, F. J. A., Leiva, V., & Ahmed, S. E. (2012). On new parameterizations of the Birnbaum-Saunders distribution. Pakistan Journal of Statistics, 28(1), 1-26.
BS7.
# Example 1 # Plotting the mass function for different parameter values curve(dBS7(x, mu=0.1, sigma=10), from=0.001, to=40, ylim=c(0, 0.20), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS7(x, mu=0.5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.1, sigma=10", "mu=0.5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS7(x, mu=0.1, sigma=10), from=0.00001, to=50, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS7(x, mu=0.5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.1, sigma=10", "mu=0.5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS7(p, mu=0.1, sigma=10), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS7(x, mu=0.1, sigma=10), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS7(n=10000, mu=0.1, sigma=10) hist(x, freq=FALSE) curve(dBS7(x, mu=0.1, sigma=10), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS7(x, mu=0.1, sigma=10), from=0.001, to=60, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dBS7(x, mu=0.1, sigma=10), from=0.001, to=40, ylim=c(0, 0.20), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dBS7(x, mu=0.5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.1, sigma=10", "mu=0.5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pBS7(x, mu=0.1, sigma=10), from=0.00001, to=50, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pBS7(x, mu=0.5, sigma=10), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.1, sigma=10", "mu=0.5, sigma=10"), col=c("royalblue1", "tomato"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qBS7(p, mu=0.1, sigma=10), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pBS7(x, mu=0.1, sigma=10), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rBS7(n=10000, mu=0.1, sigma=10) hist(x, freq=FALSE) curve(dBS7(x, mu=0.1, sigma=10), add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hBS7(x, mu=0.1, sigma=10), from=0.001, to=60, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the two-parameter
Chris-Jerry distribution with
parameters mu and sigma.
dCJ2(x, mu, sigma, log = FALSE) pCJ2(q, mu, sigma, log.p = FALSE, lower.tail = TRUE) qCJ2(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rCJ2(n, mu, sigma) hCJ2(x, mu, sigma, log = FALSE)dCJ2(x, mu, sigma, log = FALSE) pCJ2(q, mu, sigma, log.p = FALSE, lower.tail = TRUE) qCJ2(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rCJ2(n, mu, sigma) hCJ2(x, mu, sigma, log = FALSE)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The two-parameter Chris-Jerry distribution with parameters mu
and sigma has density given by
Note: In this implementation we changed the original parameters
for and for ,
we did it to implement this distribution within gamlss framework.
dCJ2 gives the density, pCJ2 gives the distribution
function, qCJ2 gives the quantile function, rCJ2
generates random deviates and hCJ2 gives the hazard function.
Manuel Gutierrez Tangarife, [email protected]
Chinedu, Eberechukwu Q., et al. "New lifetime distribution with applications to single acceptance sampling plan and scenarios of increasing hazard rates" Symmetry 15.10 (2023): 188.
# Example 1 # Plotting the density function for different parameter values curve(dCJ2(x, mu=3.5, sigma=0.01), from=0.0001, to=5, ylim=c(0, 1), col="red", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dCJ2(x, mu=2, sigma=0.05), col="green", lwd=2, add=TRUE) curve(dCJ2(x, mu=1.5, sigma=0.01), col="blue", lwd=2, add=TRUE) curve(dCJ2(x, mu=2.5, sigma=0.01), col="lightblue", lwd=2, add=TRUE) legend("topright", legend=c("mu=3.5, sigma=0.01", "mu=2, sigma=0.05", "mu=1.5, sigma=0.01", "mu=2.5, sigma=0.1"), col=c( "red", "green","blue","lightblue"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pCJ2(x, mu=2.7, sigma=0.1), from=0.0001, to=5, ylim=c(0, 1), col="red", lwd=2, main="Cumulative function", xlab="x", ylab="f(x)") curve(pCJ2(x, mu=2.3, sigma=0.5), col="green", lwd=2, add=TRUE) curve(pCJ2(x, mu=2.8, sigma=0.2), col="blue", lwd=2, add=TRUE) curve(pCJ2(x, mu=3.8, sigma=0.3), col="lightblue", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2.75, sigma=0.1", "mu=2.3, sigma=0.5", "mu=2.8, sigma=0.2", "mu=3.8, sigma=0.3"), col=c( "red", "green","blue","lightblue"), lwd=2, cex=0.6) # Example 3 # Checking the quantile function p <- seq(from=0.0001, to=0.99999, length.out=100) plot(x=qCJ2(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pCJ2(x, mu=2.3, sigma=1.7), from=0.0001, add=TRUE, col="red", lwd=2.5) # Example 4 # Comparing the random generator output with # the theoretical probabilities x <- rCJ2(n=10000, mu=1.5, sigma=2.5) hist(x, freq=FALSE) curve(dCJ2(x, mu=1.5, sigma=2.5), from=0.001, to=8, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hCJ2(x, mu=0.85, sigma=0.15), from=0.0001, to=5, ylim=c(0, 1), col="red", lwd=2, main="Hazard function", xlab="x", ylab="f(x)") curve(hCJ2(x, mu=1, sigma=0.05), col="green", lwd=2, add=TRUE) curve(hCJ2(x, mu=0.9, sigma=0.1), col="blue", lwd=2, add=TRUE) curve(hCJ2(x, mu=1.15, sigma=0.1), col="lightblue", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.85, sigma=0.15", "mu=1, sigma=0.05", "mu=0.9, sigma=0.1", "mu=1.15, sigma=0.1"), col=c( "red", "green","blue","lightblue"), lwd=2, cex=0.5)# Example 1 # Plotting the density function for different parameter values curve(dCJ2(x, mu=3.5, sigma=0.01), from=0.0001, to=5, ylim=c(0, 1), col="red", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dCJ2(x, mu=2, sigma=0.05), col="green", lwd=2, add=TRUE) curve(dCJ2(x, mu=1.5, sigma=0.01), col="blue", lwd=2, add=TRUE) curve(dCJ2(x, mu=2.5, sigma=0.01), col="lightblue", lwd=2, add=TRUE) legend("topright", legend=c("mu=3.5, sigma=0.01", "mu=2, sigma=0.05", "mu=1.5, sigma=0.01", "mu=2.5, sigma=0.1"), col=c( "red", "green","blue","lightblue"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pCJ2(x, mu=2.7, sigma=0.1), from=0.0001, to=5, ylim=c(0, 1), col="red", lwd=2, main="Cumulative function", xlab="x", ylab="f(x)") curve(pCJ2(x, mu=2.3, sigma=0.5), col="green", lwd=2, add=TRUE) curve(pCJ2(x, mu=2.8, sigma=0.2), col="blue", lwd=2, add=TRUE) curve(pCJ2(x, mu=3.8, sigma=0.3), col="lightblue", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2.75, sigma=0.1", "mu=2.3, sigma=0.5", "mu=2.8, sigma=0.2", "mu=3.8, sigma=0.3"), col=c( "red", "green","blue","lightblue"), lwd=2, cex=0.6) # Example 3 # Checking the quantile function p <- seq(from=0.0001, to=0.99999, length.out=100) plot(x=qCJ2(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pCJ2(x, mu=2.3, sigma=1.7), from=0.0001, add=TRUE, col="red", lwd=2.5) # Example 4 # Comparing the random generator output with # the theoretical probabilities x <- rCJ2(n=10000, mu=1.5, sigma=2.5) hist(x, freq=FALSE) curve(dCJ2(x, mu=1.5, sigma=2.5), from=0.001, to=8, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hCJ2(x, mu=0.85, sigma=0.15), from=0.0001, to=5, ylim=c(0, 1), col="red", lwd=2, main="Hazard function", xlab="x", ylab="f(x)") curve(hCJ2(x, mu=1, sigma=0.05), col="green", lwd=2, add=TRUE) curve(hCJ2(x, mu=0.9, sigma=0.1), col="blue", lwd=2, add=TRUE) curve(hCJ2(x, mu=1.15, sigma=0.1), col="lightblue", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.85, sigma=0.15", "mu=1, sigma=0.05", "mu=0.9, sigma=0.1", "mu=1.15, sigma=0.1"), col=c( "red", "green","blue","lightblue"), lwd=2, cex=0.5)
Density, distribution function, quantile function,
random generation and hazard function for the Cosine Sine Exponential distribution
with parameters mu, sigma and nu.
dCS2e(x, mu, sigma, nu, log = FALSE) pCS2e(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qCS2e(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rCS2e(n, mu, sigma, nu) hCS2e(x, mu, sigma, nu)dCS2e(x, mu, sigma, nu, log = FALSE) pCS2e(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qCS2e(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rCS2e(n, mu, sigma, nu) hCS2e(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Cosine Sine Exponential Distribution with parameters mu,
sigma and nu has density given by
for , , and .
dCS2e gives the density, pCS2e gives the distribution
function, qCS2e gives the quantile function, rCS2e
generates random deviates and hCS2e gives the hazard function.
Juan Pablo Ramirez
Chesneau, C., Bakouch, H. S., & Hussain, T. (2019). A new class of probability distributions via cosine and sine functions with applications. Communications in Statistics-Simulation and Computation, 48(8), 2287-2300.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow=c(1,1)) curve(dCS2e(x, mu=1, sigma=0.1, nu =0.1), from=0, to=1, ylim=c(0, 3), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pCS2e(x, mu=1, sigma=0.1, nu =0.1), from=0, to=1, col="red", las=1, ylab="F(x)") curve(pCS2e(x, mu=1, sigma=0.1, nu =0.1, lower.tail=FALSE), from=0, to=1, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qCS2e(p, mu=0.1, sigma=1, nu=0.1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pCS2e(x, mu=0.1, sigma=1, nu=0.1), from=0, add=TRUE, col="red") ## The random function hist(rCS2e(n=10000, mu=0.1, sigma=1, nu=0.1), freq=FALSE, xlab="x", las=1, main="") curve(dCS2e(x, mu=0.1, sigma=1, nu=0.1), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hCS2e(x, mu=1, sigma=0.1, nu =0.1), from=0, to=1, ylim=c(0, 10), col=2, ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow=c(1,1)) curve(dCS2e(x, mu=1, sigma=0.1, nu =0.1), from=0, to=1, ylim=c(0, 3), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pCS2e(x, mu=1, sigma=0.1, nu =0.1), from=0, to=1, col="red", las=1, ylab="F(x)") curve(pCS2e(x, mu=1, sigma=0.1, nu =0.1, lower.tail=FALSE), from=0, to=1, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qCS2e(p, mu=0.1, sigma=1, nu=0.1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pCS2e(x, mu=0.1, sigma=1, nu=0.1), from=0, add=TRUE, col="red") ## The random function hist(rCS2e(n=10000, mu=0.1, sigma=1, nu=0.1), freq=FALSE, xlab="x", las=1, main="") curve(dCS2e(x, mu=0.1, sigma=1, nu=0.1), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hCS2e(x, mu=1, sigma=0.1, nu =0.1), from=0, to=1, ylim=c(0, 10), col=2, ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Extended Exponential Geometric distribution
with parameters mu and sigma.
dEEG(x, mu, sigma, log = FALSE) pEEG(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qEEG(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rEEG(n, mu, sigma) hEEG(x, mu, sigma)dEEG(x, mu, sigma, log = FALSE) pEEG(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qEEG(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rEEG(n, mu, sigma) hEEG(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Extended Exponential Geometric distribution with parameters mu,
and sigmahas density given by
for , and .
dEEG gives the density, pEEG gives the distribution
function, qEEG gives the quantile function, rEEG
generates random deviates and hEEG gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Adamidis, K., Dimitrakopoulou, T., & Loukas, S. (2005). On an extension of the exponential-geometric distribution. Statistics & probability letters, 73(3), 259-269.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow=c(1,1)) curve(dEEG(x, mu = 1, sigma =3), from = 0, to = 10, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pEEG(x, mu = 1, sigma =3), from = 0, to = 10, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pEEG(x, mu = 1, sigma =3, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qEEG(p = p, mu = 1, sigma =0.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pEEG(x, mu = 1, sigma =0.5), from = 0, add = TRUE, col = "red") ## The random function hist(rEEG(1000, mu = 1, sigma =1), freq = FALSE, xlab = "x", ylim = c(0, 0.9), las = 1, main = "") curve(dEEG(x, mu = 1, sigma =1), from = 0, add = TRUE, col = "red", ylim = c(0, 0.8)) ## The Hazard function par(mfrow=c(1,1)) curve(hEEG(x, mu = 1, sigma =0.5), from = 0, to = 2, col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow=c(1,1)) curve(dEEG(x, mu = 1, sigma =3), from = 0, to = 10, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pEEG(x, mu = 1, sigma =3), from = 0, to = 10, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pEEG(x, mu = 1, sigma =3, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qEEG(p = p, mu = 1, sigma =0.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pEEG(x, mu = 1, sigma =0.5), from = 0, add = TRUE, col = "red") ## The random function hist(rEEG(1000, mu = 1, sigma =1), freq = FALSE, xlab = "x", ylim = c(0, 0.9), las = 1, main = "") curve(dEEG(x, mu = 1, sigma =1), from = 0, add = TRUE, col = "red", ylim = c(0, 0.8)) ## The Hazard function par(mfrow=c(1,1)) curve(hEEG(x, mu = 1, sigma =0.5), from = 0, to = 2, col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the four parameter Exponentiated Generalized Gamma distribution
with parameters mu, sigma, nu and tau.
dEGG(x, mu, sigma, nu, tau, log = FALSE) pEGG(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qEGG(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rEGG(n, mu, sigma, nu, tau) hEGG(x, mu, sigma, nu, tau)dEGG(x, mu, sigma, nu, tau, log = FALSE) pEGG(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qEGG(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rEGG(n, mu, sigma, nu, tau) hEGG(x, mu, sigma, nu, tau)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
tau |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
Four-Parameter Exponentiated Generalized Gamma distribution with parameters mu,
sigma, nu and tau has density given by
for .
dEGG gives the density, pEGG gives the distribution
function, qEGG gives the quantile function, rEGG
generates random deviates and hEGG gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Cordeiro, G. M., Ortega, E. M., & Silva, G. O. (2011). The exponentiated generalized gamma distribution with application to lifetime data. Journal of statistical computation and simulation, 81(7), 827-842.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.000001, to=1.5, ylim=c(0, 2.5), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.000001, to=1.5, col="red", las=1, ylab="F(x)") curve(pEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5, lower.tail=FALSE), from=0.000001, to=1.5, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEGG(p, mu=0.1, sigma=0.8, nu=10, tau=1.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.00001, add=TRUE, col="red") ## The random function hist(rEGG(n=100, mu=0.1, sigma=0.8, nu=10, tau=1.5), freq=FALSE, xlab="x", las=1, main="") curve(dEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.0001, to=2, add=TRUE, col="red") ## The Hazard function curve(hEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.0001, to=1.5, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.000001, to=1.5, ylim=c(0, 2.5), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.000001, to=1.5, col="red", las=1, ylab="F(x)") curve(pEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5, lower.tail=FALSE), from=0.000001, to=1.5, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEGG(p, mu=0.1, sigma=0.8, nu=10, tau=1.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.00001, add=TRUE, col="red") ## The random function hist(rEGG(n=100, mu=0.1, sigma=0.8, nu=10, tau=1.5), freq=FALSE, xlab="x", las=1, main="") curve(dEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.0001, to=2, add=TRUE, col="red") ## The Hazard function curve(hEGG(x, mu=0.1, sigma=0.8, nu=10, tau=1.5), from=0.0001, to=1.5, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Exponentiated Modifien Weibull Extension distribution
with parameters mu, sigma, nu and tau.
dEMWEx(x, mu, sigma, nu, tau, log = FALSE) pEMWEx(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qEMWEx(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rEMWEx(n, mu, sigma, nu, tau) hEMWEx(x, mu, sigma, nu, tau)dEMWEx(x, mu, sigma, nu, tau, log = FALSE) pEMWEx(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qEMWEx(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rEMWEx(n, mu, sigma, nu, tau) hEMWEx(x, mu, sigma, nu, tau)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
tau |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Exponentiated Modified Weibull Extension Distribution with parameters mu,
sigma, nu and tau has density given by
for , , , and .
dEMWEx gives the density, pEMWEx gives the distribution
function, qEMWEx gives the quantile function, rEMWEx
generates random deviates and hEMWEx gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Sarhan, A. M., & Apaloo, J. (2013). Exponentiated modified Weibull extension distribution. Reliability Engineering & System Safety, 112, 137-144.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dEMWEx(x, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), from=0, to=100, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pEMWEx(x, mu = (1/4), sigma =1, nu=1, tau=2), from = 0, to = 1, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pEMWEx(x, mu = (1/4), sigma =1, nu=1, tau=2, lower.tail = FALSE), from = 0, to = 1, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qEMWEx(p = p, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pEMWEx(x, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), from = 0, add = TRUE, col = "red") ## The random function hist(rEMWEx(1000, mu = (1/4), sigma =1, nu=1, tau=2), freq = FALSE, xlab = "x", las = 1, main = "") curve(dEMWEx(x, mu = (1/4), sigma =1, nu=1, tau=2), from = 0, add = TRUE, col = "red", ylim = c(0, 0.5)) ## The Hazard function( par(mfrow=c(1,1)) curve(hEMWEx(x, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), from = 0, to = 80, col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dEMWEx(x, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), from=0, to=100, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pEMWEx(x, mu = (1/4), sigma =1, nu=1, tau=2), from = 0, to = 1, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pEMWEx(x, mu = (1/4), sigma =1, nu=1, tau=2, lower.tail = FALSE), from = 0, to = 1, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qEMWEx(p = p, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pEMWEx(x, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), from = 0, add = TRUE, col = "red") ## The random function hist(rEMWEx(1000, mu = (1/4), sigma =1, nu=1, tau=2), freq = FALSE, xlab = "x", las = 1, main = "") curve(dEMWEx(x, mu = (1/4), sigma =1, nu=1, tau=2), from = 0, add = TRUE, col = "red", ylim = c(0, 0.5)) ## The Hazard function( par(mfrow=c(1,1)) curve(hEMWEx(x, mu = 49.046, sigma =3.148, nu=0.00005, tau=0.1), from = 0, to = 80, col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Extended Odd Fr?chet-Nadarajah-Haghighi distribution
with parameters mu, sigma, nu and tau.
dEOFNH(x, mu, sigma, nu, tau, log = FALSE) pEOFNH(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qEOFNH(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rEOFNH(n, mu, sigma, nu, tau) hEOFNH(x, mu, sigma, nu, tau)dEOFNH(x, mu, sigma, nu, tau, log = FALSE) pEOFNH(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qEOFNH(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rEOFNH(n, mu, sigma, nu, tau) hEOFNH(x, mu, sigma, nu, tau)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
tau |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
Tthe Extended Odd Frechet-Nadarajah-Haghighi mu,
sigma, nu and tau has density given by
for , , , and .
dEOFNH gives the density, pEOFNH gives the distribution
function, qEOFNH gives the quantile function, rEOFNH
generates random numbers and hEOFNH gives the hazard function.
Helber Santiago Padilla, [email protected]
Nasiru, S. (2018). Extended Odd Fréchet‐G Family of Distributions Journal of Probability and Statistics, 2018(1), 2931326.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ##The probability density function par(mfrow=c(1, 1)) curve(dEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, to=10, ylim=c(0, 0.25), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pEOFNH(x,mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from = 0, to = 10, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1, lower.tail = FALSE), from = 0, to = 10, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ##The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEOFNH(p, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, add=TRUE, col="red") ##The random function hist(rEOFNH(n=10000, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), freq=FALSE, xlab="x", las=1, main="") curve(dEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, add=TRUE, col="red", ylim=c(0,1.25)) ##The Hazard function par(mfrow=c(1,1)) curve(hEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, to=10, ylim=c(0, 1), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ##The probability density function par(mfrow=c(1, 1)) curve(dEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, to=10, ylim=c(0, 0.25), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pEOFNH(x,mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from = 0, to = 10, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1, lower.tail = FALSE), from = 0, to = 10, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ##The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEOFNH(p, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, add=TRUE, col="red") ##The random function hist(rEOFNH(n=10000, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), freq=FALSE, xlab="x", las=1, main="") curve(dEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, add=TRUE, col="red", ylim=c(0,1.25)) ##The Hazard function par(mfrow=c(1,1)) curve(hEOFNH(x, mu=18.5, sigma=5.1, nu=0.1, tau=0.1), from=0, to=10, ylim=c(0, 1), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the exponentiated Weibull distribution with
parameters mu, sigma and nu.
dEW(x, mu, sigma, nu, log = FALSE) pEW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qEW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rEW(n, mu, sigma, nu) hEW(x, mu, sigma, nu)dEW(x, mu, sigma, nu, log = FALSE) pEW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qEW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rEW(n, mu, sigma, nu) hEW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
scale parameter. |
sigma, nu
|
shape parameters. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Exponentiated Weibull Distribution with parameters mu,
sigma and nu has density given by
for , , and .
dEW gives the density, pEW gives the distribution
function, qEW gives the quantile function, rEW
generates random deviates and hEW gives the hazard function.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dEW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, ylim=c(0, 2.5), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pEW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, col="red", las=1, ylab="F(x)") curve(pEW(x, mu=2, sigma=1.5, nu=0.5, lower.tail=FALSE), from=0, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEW(p, mu=2, sigma=1.5, nu=0.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pEW(x, mu=2, sigma=1.5, nu=0.5), from=0, add=TRUE, col="red") ## The random function hist(rEW(n=10000, mu=2, sigma=1.5, nu=0.5), freq=FALSE, xlab="x", las=1, main="") curve(dEW(x, mu=2, sigma=1.5, nu=0.5), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hEW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, ylim=c(0, 7), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dEW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, ylim=c(0, 2.5), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pEW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, col="red", las=1, ylab="F(x)") curve(pEW(x, mu=2, sigma=1.5, nu=0.5, lower.tail=FALSE), from=0, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEW(p, mu=2, sigma=1.5, nu=0.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pEW(x, mu=2, sigma=1.5, nu=0.5), from=0, add=TRUE, col="red") ## The random function hist(rEW(n=10000, mu=2, sigma=1.5, nu=0.5), freq=FALSE, xlab="x", las=1, main="") curve(dEW(x, mu=2, sigma=1.5, nu=0.5), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hEW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, ylim=c(0, 7), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the exponentiated XLindley distribution with
parameters mu and sigma.
dEXL(x, mu, sigma, log = FALSE) pEXL(q, mu, sigma, log.p = FALSE, lower.tail = TRUE) qEXL(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rEXL(n, mu, sigma) hEXL(x, mu, sigma, log = FALSE)dEXL(x, mu, sigma, log = FALSE) pEXL(q, mu, sigma, log.p = FALSE, lower.tail = TRUE) qEXL(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rEXL(n, mu, sigma) hEXL(x, mu, sigma, log = FALSE)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The exponentiated XLindley with parameters mu and sigma
has density given by
for , and .
Note: In this implementation we changed the original parameters for
and for , we did it to implement this distribution
within gamlss framework.
dEXL gives the density, pEXL gives the distribution
function, qEXL gives the quantile function, rEXL
generates random deviates and hEXL gives the hazard function.
Manuel Gutierrez Tangarife, [email protected]
Alomair, A. M., Ahmed, M., Tariq, S., Ahsan-ul-Haq, M., & Talib, J. (2024). An exponentiated XLindley distribution with properties, inference and applications. Heliyon, 10(3).
EXL.
# Example 1 # Plotting the mass function for different parameter values curve(dEXL(x, mu=0.5, sigma=0.5), from=0, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dEXL(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(dEXL(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dEXL(x, mu=0.5, sigma=1), from=0, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dEXL(x, mu=1, sigma=1), col="tomato", lwd=2, add=TRUE) curve(dEXL(x, mu=1.5, sigma=1), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1", "mu=1.0, sigma=1", "mu=1.5, sigma=1"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dEXL(x, mu=0.5, sigma=1.5), from=0., to=8, ylim=c(0, 1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dEXL(x, mu=1, sigma=1.5), col="tomato", lwd=2, add=TRUE) curve(dEXL(x, mu=1.5, sigma=1.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1.5", "mu=1.0, sigma=1.5", "mu=1.5, sigma=1.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pEXL(x, mu=0.5, sigma=0.5), from=0, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="f(x)") curve(pEXL(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(pEXL(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEXL(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pEXL(x, mu=2.3, sigma=1.7), from=0, add=TRUE, col="tomato", lwd=2.5) # Comparing quantile, density and cumulative p <- c(0.25, 0.5, 0.75) quantile <- qEXL(p=p, mu=2.3, sigma=1.7) for(i in quantile){ print(integrate(dEXL, lower=0, upper=i, mu=2.3, sigma=1.7)) } pEXL(q=quantile, mu=2.3, sigma=1.7) # Example 4 # The random function x <- rEXL(n=10000, mu=1.5, sigma=2.5) hist(x, freq=FALSE) curve(dEXL(x, mu=1.5, sigma=2.5), from=0, to=20, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hEXL(x, mu=1.5, sigma=2), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values curve(dEXL(x, mu=0.5, sigma=0.5), from=0, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dEXL(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(dEXL(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dEXL(x, mu=0.5, sigma=1), from=0, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dEXL(x, mu=1, sigma=1), col="tomato", lwd=2, add=TRUE) curve(dEXL(x, mu=1.5, sigma=1), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1", "mu=1.0, sigma=1", "mu=1.5, sigma=1"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) curve(dEXL(x, mu=0.5, sigma=1.5), from=0., to=8, ylim=c(0, 1), col="royalblue1", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dEXL(x, mu=1, sigma=1.5), col="tomato", lwd=2, add=TRUE) curve(dEXL(x, mu=1.5, sigma=1.5), col="seagreen", lwd=2, add=TRUE) legend("topright", legend=c("mu=0.5, sigma=1.5", "mu=1.0, sigma=1.5", "mu=1.5, sigma=1.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pEXL(x, mu=0.5, sigma=0.5), from=0, to=5, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="f(x)") curve(pEXL(x, mu=1, sigma=0.5), col="tomato", lwd=2, add=TRUE) curve(pEXL(x, mu=1.5, sigma=0.5), col="seagreen", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.5, sigma=0.5", "mu=1.0, sigma=0.5", "mu=1.5, sigma=0.5"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qEXL(p, mu=2.3, sigma=1.7), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pEXL(x, mu=2.3, sigma=1.7), from=0, add=TRUE, col="tomato", lwd=2.5) # Comparing quantile, density and cumulative p <- c(0.25, 0.5, 0.75) quantile <- qEXL(p=p, mu=2.3, sigma=1.7) for(i in quantile){ print(integrate(dEXL, lower=0, upper=i, mu=2.3, sigma=1.7)) } pEXL(q=quantile, mu=2.3, sigma=1.7) # Example 4 # The random function x <- rEXL(n=10000, mu=1.5, sigma=2.5) hist(x, freq=FALSE) curve(dEXL(x, mu=1.5, sigma=2.5), from=0, to=20, add=TRUE, col="tomato", lwd=2) # Example 5 # The Hazard function curve(hEXL(x, mu=1.5, sigma=2), from=0.001, to=4, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the Extended Weibull distribution
with parameters mu, sigma and nu.
dExW(x, mu, sigma, nu, log = FALSE) pExW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qExW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rExW(n, mu, sigma, nu) hExW(x, mu, sigma, nu)dExW(x, mu, sigma, nu, log = FALSE) pExW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qExW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rExW(n, mu, sigma, nu) hExW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Extended Weibull distribution with parameters mu,
sigma and nu has density given by
for .
dExW gives the density, pExW gives the distribution
function, qExW gives the quantile function, rExW
generates random deviates and hExW gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Zhang, T., & Xie, M. (2007). Failure data analysis with extended Weibull distribution. Communications in Statistics—Simulation and Computation, 36(3), 579-592.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dExW(x, mu=0.3, sigma=2, nu=0.05), from=0.0001, to=2, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pExW(x, mu=0.3, sigma=2, nu=0.05), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pExW(x, mu=0.3, sigma=2, nu=0.05, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qExW(p, mu=0.3, sigma=2, nu=0.05), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pExW(x, mu=0.3, sigma=2, nu=0.05), from=0, add=TRUE, col="red") ## The random function hist(rExW(n=10000, mu=0.3, sigma=2, nu=0.05), freq=FALSE, xlab="x", ylim=c(0, 2), las=1, main="") curve(dExW(x, mu=0.3, sigma=2, nu=0.05), from=0.001, to=4, add=TRUE, col="red") ## The Hazard function curve(hExW(x, mu=0.3, sigma=2, nu=0.05), from=0.001, to=4, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dExW(x, mu=0.3, sigma=2, nu=0.05), from=0.0001, to=2, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pExW(x, mu=0.3, sigma=2, nu=0.05), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pExW(x, mu=0.3, sigma=2, nu=0.05, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qExW(p, mu=0.3, sigma=2, nu=0.05), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pExW(x, mu=0.3, sigma=2, nu=0.05), from=0, add=TRUE, col="red") ## The random function hist(rExW(n=10000, mu=0.3, sigma=2, nu=0.05), freq=FALSE, xlab="x", ylim=c(0, 2), las=1, main="") curve(dExW(x, mu=0.3, sigma=2, nu=0.05), from=0.001, to=4, add=TRUE, col="red") ## The Hazard function curve(hExW(x, mu=0.3, sigma=2, nu=0.05), from=0.001, to=4, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
These functions define the density, distribution function, quantile
function and random generation for the Ex-Wald distribution
with parameter , and .
dExWALD(x, mu = 1.5, sigma = 1.5, nu = 2, log = FALSE) pExWALD(q, mu = 1.5, sigma = 1.5, nu = 2, lower.tail = TRUE, log.p = FALSE) qExWALD(p, mu = 1.5, sigma = 1.5, nu = 2) rExWALD(n, mu = 1.5, sigma = 1.5, nu = 2)dExWALD(x, mu = 1.5, sigma = 1.5, nu = 2, log = FALSE) pExWALD(q, mu = 1.5, sigma = 1.5, nu = 2, lower.tail = TRUE, log.p = FALSE) qExWALD(p, mu = 1.5, sigma = 1.5, nu = 2) rExWALD(n, mu = 1.5, sigma = 1.5, nu = 2)
x, q
|
vector of (non-negative integer) quantiles. |
mu |
vector of the mu parameter. |
sigma |
vector of the sigma parameter. |
nu |
vector of the nu parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of random values to return. |
The Wald distribution with parameters ,
and has density given by
where ,
and
corresponds to the cumulative function of
the Wald distribution.
More details about those expressions can be found on page 680 from Heathcote (2004).
dExWALD gives the density, pExWALD gives the distribution
function, qExWALD gives the quantile function, rExWALD
generates random deviates.
Freddy Hernandez, [email protected]
Schwarz, W. (2001). The ex-Wald distribution as a descriptive model of response times. Behavior Research Methods, Instruments, & Computers, 33, 457-469.
Heathcote, A. (2004). Fitting Wald and ex-Wald distributions to response time data: An example using functions for the S-PLUS package. Behavior Research Methods, Instruments, & Computers, 36, 678-694.
# Example 1 # Plotting the mass function for different parameter values curve(dExWALD(x, mu=0.15, sigma=52.5, nu=50), ylim=c(0, 0.005), from=0, to=1200, col="cadetblue3", las=1, ylab="f(x)") curve(dExWALD(x, mu=0.20, sigma=70, nu=50), add=TRUE, col= "purple") curve(dExWALD(x, mu=0.25, sigma=87.5, nu=50), add=TRUE, col="goldenrod") curve(dExWALD(x, mu=0.20, sigma=70, nu=115), add=TRUE, col="tomato") curve(dExWALD(x, mu=0.20, sigma=70, nu=35), add=TRUE, col="blue") legend("topright", col=c("cadetblue3", "purple", "goldenrod", "tomato", "blue"), lty=1, bty="n", legend=c("mu=0.15, sigma=52.5, nu=50", "mu=0.20, sigma=70.0, nu=50", "mu=0.25, sigma=87.5, nu=50", "mu=0.20, sigma=70.0, nu=115", "mu=0.20, sigma=70.0, nu=35")) # Example 2 # Checking if the cumulative curves converge to 1 curve(pExWALD(x, mu=0.15, sigma=52.5, nu=50), ylim=c(0, 1), from=0, to=1200, col="cadetblue3", las=1, ylab="F(x)") curve(pExWALD(x, mu=0.20, sigma=70, nu=50), add=TRUE, col= "purple") curve(pExWALD(x, mu=0.25, sigma=87.5, nu=50), add=TRUE, col="goldenrod") curve(pExWALD(x, mu=0.20, sigma=70, nu=115), add=TRUE, col="tomato") curve(pExWALD(x, mu=0.20, sigma=70, nu=35), add=TRUE, col="blue") legend("bottomright", col=c("cadetblue3", "purple", "goldenrod", "tomato", "blue"), lty=1, bty="n", legend=c("mu=0.15, sigma=52.5, nu=50", "mu=0.20, sigma=70.0, nu=50", "mu=0.25, sigma=87.5, nu=50", "mu=0.20, sigma=70.0, nu=115", "mu=0.20, sigma=70.0, nu=35")) # Example 3 # Checking the quantile function mu <- 5 sigma <- 3 nu <- 2 p <- seq(from=0.1, to=0.99, length.out=100) plot(x=qExWALD(p, mu=mu, sigma=sigma, nu=nu), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pExWALD(x, mu=mu, sigma=sigma, nu=nu), from=0, add=TRUE, col="red") # Example 4 # Comparing the random generator output with # the theoretical probabilities mu <- 0.2 sigma <- 70 nu <- 35 x <- rExWALD(n=10000, mu=mu, sigma=sigma, nu=nu) hist(x, freq=FALSE) curve(dExWALD(x, mu=mu, sigma=sigma, nu=nu), col="tomato", add=TRUE)# Example 1 # Plotting the mass function for different parameter values curve(dExWALD(x, mu=0.15, sigma=52.5, nu=50), ylim=c(0, 0.005), from=0, to=1200, col="cadetblue3", las=1, ylab="f(x)") curve(dExWALD(x, mu=0.20, sigma=70, nu=50), add=TRUE, col= "purple") curve(dExWALD(x, mu=0.25, sigma=87.5, nu=50), add=TRUE, col="goldenrod") curve(dExWALD(x, mu=0.20, sigma=70, nu=115), add=TRUE, col="tomato") curve(dExWALD(x, mu=0.20, sigma=70, nu=35), add=TRUE, col="blue") legend("topright", col=c("cadetblue3", "purple", "goldenrod", "tomato", "blue"), lty=1, bty="n", legend=c("mu=0.15, sigma=52.5, nu=50", "mu=0.20, sigma=70.0, nu=50", "mu=0.25, sigma=87.5, nu=50", "mu=0.20, sigma=70.0, nu=115", "mu=0.20, sigma=70.0, nu=35")) # Example 2 # Checking if the cumulative curves converge to 1 curve(pExWALD(x, mu=0.15, sigma=52.5, nu=50), ylim=c(0, 1), from=0, to=1200, col="cadetblue3", las=1, ylab="F(x)") curve(pExWALD(x, mu=0.20, sigma=70, nu=50), add=TRUE, col= "purple") curve(pExWALD(x, mu=0.25, sigma=87.5, nu=50), add=TRUE, col="goldenrod") curve(pExWALD(x, mu=0.20, sigma=70, nu=115), add=TRUE, col="tomato") curve(pExWALD(x, mu=0.20, sigma=70, nu=35), add=TRUE, col="blue") legend("bottomright", col=c("cadetblue3", "purple", "goldenrod", "tomato", "blue"), lty=1, bty="n", legend=c("mu=0.15, sigma=52.5, nu=50", "mu=0.20, sigma=70.0, nu=50", "mu=0.25, sigma=87.5, nu=50", "mu=0.20, sigma=70.0, nu=115", "mu=0.20, sigma=70.0, nu=35")) # Example 3 # Checking the quantile function mu <- 5 sigma <- 3 nu <- 2 p <- seq(from=0.1, to=0.99, length.out=100) plot(x=qExWALD(p, mu=mu, sigma=sigma, nu=nu), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pExWALD(x, mu=mu, sigma=sigma, nu=nu), from=0, add=TRUE, col="red") # Example 4 # Comparing the random generator output with # the theoretical probabilities mu <- 0.2 sigma <- 70 nu <- 35 x <- rExWALD(n=10000, mu=mu, sigma=sigma, nu=nu) hist(x, freq=FALSE) curve(dExWALD(x, mu=mu, sigma=sigma, nu=nu), col="tomato", add=TRUE)
Density, distribution function, quantile function,
random generation and hazard function for the Flexible Weibull Extension distribution with
parameters mu and sigma.
dFWE(x, mu, sigma, log = FALSE) pFWE(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qFWE(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rFWE(n, mu, sigma) hFWE(x, mu, sigma)dFWE(x, mu, sigma, log = FALSE) pFWE(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qFWE(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rFWE(n, mu, sigma) hFWE(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Flexible Weibull extension with parameters mu and sigma
has density given by
for .
dFWE gives the density, pFWE gives the distribution
function, qFWE gives the quantile function, rFWE
generates random deviates and hFWE gives the hazard function.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dFWE(x, mu=0.75, sigma=0.5), from=0, to=3, ylim=c(0, 1.7), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pFWE(x, mu=0.75, sigma=0.5), from=0, to=3, col="red", las=1, ylab="F(x)") curve(pFWE(x, mu=0.75, sigma=0.5, lower.tail=FALSE), from=0, to=3, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qFWE(p, mu=0.75, sigma=0.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pFWE(x, mu=0.75, sigma=0.5), from=0, add=TRUE, col="red") ## The random function hist(rFWE(n=1000, mu=2, sigma=0.5), freq=FALSE, xlab="x", ylim=c(0, 2), las=1, main="") curve(dFWE(x, mu=2, sigma=0.5), from=0, to=3, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hFWE(x, mu=0.75, sigma=0.5), from=0, to=2, ylim=c(0, 2.5), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dFWE(x, mu=0.75, sigma=0.5), from=0, to=3, ylim=c(0, 1.7), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pFWE(x, mu=0.75, sigma=0.5), from=0, to=3, col="red", las=1, ylab="F(x)") curve(pFWE(x, mu=0.75, sigma=0.5, lower.tail=FALSE), from=0, to=3, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qFWE(p, mu=0.75, sigma=0.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pFWE(x, mu=0.75, sigma=0.5), from=0, add=TRUE, col="red") ## The random function hist(rFWE(n=1000, mu=2, sigma=0.5), freq=FALSE, xlab="x", ylim=c(0, 2), las=1, main="") curve(dFWE(x, mu=2, sigma=0.5), from=0, to=3, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hFWE(x, mu=0.75, sigma=0.5), from=0, to=2, ylim=c(0, 2.5), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Gamma Weibull distribution
with parameters mu, sigma, nu and tau.
dGammaW(x, mu, sigma, nu, log = FALSE) pGammaW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGammaW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rGammaW(n, mu, sigma, nu) hGammaW(x, mu, sigma, nu)dGammaW(x, mu, sigma, nu, log = FALSE) pGammaW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGammaW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rGammaW(n, mu, sigma, nu) hGammaW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Gamma Weibull Distribution with parameters mu,
sigma and nu has density given by
for , , and .
dGammaW gives the density, pGammaW gives the distribution
function, qGammaW gives the quantile function, rGammaW
generates random deviates and hGammaW gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Stacy, E. W. (1962). A generalization of the gamma distribution. The Annals of mathematical statistics, 1187-1192.
# Example 1 # Plotting the mass function for different parameter values ## The probability density function curve(dGammaW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, col="red", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dGammaW(x, mu=2.4, sigma=1.5, nu=1.3), col="blue", lwd=2, add=TRUE) legend("topright", legend=c("mu=2.0, sigma=1.5, nu=0.5", "mu=2.4, sigma=1.5, nu=1.3"), col=c("red", "blue"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pGammaW(x, mu=0.5, sigma=2, nu=1), from=0, to=3, col="red", lwd=2, ylab="F(x)") curve(pGammaW(x, mu=2.4, sigma=1.5, nu=1.3), col="blue", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2.0, sigma=1.5, nu=0.5", "mu=2.4, sigma=1.5, nu=1.3"), col=c("red", "blue"), lwd=2, cex=0.6) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qGammaW(p, mu=2.3, sigma=1.7, nu=1.2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pGammaW(x, mu=2.3, sigma=1.7, nu=1.2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rGammaW(n=10000, mu=2.4, sigma=1.5, nu=1.3) hist(x, freq=FALSE) curve(dGammaW(x, mu=2.4, sigma=1.5, nu=1.3), add=TRUE, col="tomato", lwd=2) # The Hazard function curve(hGammaW(x, mu=2.4, sigma=1.5, nu=1.3), from=0, to=5, col="red", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values ## The probability density function curve(dGammaW(x, mu=2, sigma=1.5, nu=0.5), from=0, to=2, col="red", lwd=2, main="Density function", xlab="x", ylab="f(x)") curve(dGammaW(x, mu=2.4, sigma=1.5, nu=1.3), col="blue", lwd=2, add=TRUE) legend("topright", legend=c("mu=2.0, sigma=1.5, nu=0.5", "mu=2.4, sigma=1.5, nu=1.3"), col=c("red", "blue"), lwd=2, cex=0.6) # Example 2 # Checking if the cumulative curves converge to 1 curve(pGammaW(x, mu=0.5, sigma=2, nu=1), from=0, to=3, col="red", lwd=2, ylab="F(x)") curve(pGammaW(x, mu=2.4, sigma=1.5, nu=1.3), col="blue", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=2.0, sigma=1.5, nu=0.5", "mu=2.4, sigma=1.5, nu=1.3"), col=c("red", "blue"), lwd=2, cex=0.6) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qGammaW(p, mu=2.3, sigma=1.7, nu=1.2), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pGammaW(x, mu=2.3, sigma=1.7, nu=1.2), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function x <- rGammaW(n=10000, mu=2.4, sigma=1.5, nu=1.3) hist(x, freq=FALSE) curve(dGammaW(x, mu=2.4, sigma=1.5, nu=1.3), add=TRUE, col="tomato", lwd=2) # The Hazard function curve(hGammaW(x, mu=2.4, sigma=1.5, nu=1.3), from=0, to=5, col="red", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the generalized Gompertz distribution with
parameters mu sigma and nu.
dGGD(x, mu, sigma, nu, log = FALSE) pGGD(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGGD(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rGGD(n, mu, sigma, nu) hGGD(x, mu, sigma, nu)dGGD(x, mu, sigma, nu, log = FALSE) pGGD(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGGD(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rGGD(n, mu, sigma, nu) hGGD(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu, nu
|
scale parameter. |
sigma |
shape parameters. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Generalized Gompertz Distribution with parameters mu,
sigma and nu has density given by
for , , and .
dGGD gives the density, pGGD gives the distribution
function, qGGD gives the quantile function, rGGD
generates random deviates and hGGD gives the hazard function.
Johan David Marin Benjumea, [email protected]
El-Gohary, A., Alshamrani, A., & Al-Otaibi, A. N. (2013). The generalized Gompertz distribution. Applied mathematical modelling, 37(1-2), 13-24.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow = c(1, 1)) curve(dGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, to = 4, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, to = 4, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pGGD(x, mu=1, sigma=0.3, nu=1.5, lower.tail = FALSE), from = 0, to = 4, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qGGD(p=p, mu=1, sigma=0.3, nu=1.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, add = TRUE, col = "red") ## The random function hist(rGGD(1000, mu=1, sigma=0.3, nu=1.5), freq = FALSE, xlab = "x", las = 1, ylim = c(0, 0.7), main = "") curve(dGGD(x,mu=1, sigma=0.3, nu=1.5), from = 0, to =8, add = TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, to = 3, col = "red", ylab = "The hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow = c(1, 1)) curve(dGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, to = 4, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, to = 4, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pGGD(x, mu=1, sigma=0.3, nu=1.5, lower.tail = FALSE), from = 0, to = 4, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qGGD(p=p, mu=1, sigma=0.3, nu=1.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, add = TRUE, col = "red") ## The random function hist(rGGD(1000, mu=1, sigma=0.3, nu=1.5), freq = FALSE, xlab = "x", las = 1, ylim = c(0, 0.7), main = "") curve(dGGD(x,mu=1, sigma=0.3, nu=1.5), from = 0, to =8, add = TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hGGD(x, mu=1, sigma=0.3, nu=1.5), from = 0, to = 3, col = "red", ylab = "The hazard function", las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Generalized Inverse Weibull distribution
with parameters mu, sigma and nu.
dGIW(x, mu, sigma, nu, log = FALSE) pGIW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGIW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rGIW(n, mu, sigma, nu) hGIW(x, mu, sigma, nu)dGIW(x, mu, sigma, nu, log = FALSE) pGIW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGIW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rGIW(n, mu, sigma, nu) hGIW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Generalized Inverse Weibull distribution mu,
sigma and nu has density given by
for .
dGIW gives the density, pGIW gives the distribution
function, qGIW gives the quantile function, rGIW
generates random deviates and hGIW gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
De Gusmao, F. R., Ortega, E. M., & Cordeiro, G. M. (2011). The generalized inverse Weibull distribution. Statistical Papers, 52, 591-619.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dGIW(x, mu=3, sigma=5, nu=0.5), from=0.001, to=8, col="red", ylab="f(x)", las=1) ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pGIW(x, mu=3, sigma=5, nu=0.5), from=0.0001, to=14, col="red", las=1, ylab="F(x)") curve(pGIW(x, mu=3, sigma=5, nu=0.5, lower.tail=FALSE), from=0.0001, to=14, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qGIW(p, mu=3, sigma=5, nu=0.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pGIW(x, mu=3, sigma=5, nu=0.5), from=0, add=TRUE, col="red") ## The random function hist(rGIW(n=1000, mu=3, sigma=5, nu=0.5), freq=FALSE, xlab="x", ylim=c(0, 0.8), las=1, main="") curve(dGIW(x, mu=3, sigma=5, nu=0.5), from=0.001, to=14, add=TRUE, col="red") ## The Hazard function curve(hGIW(x, mu=3, sigma=5, nu=0.5), from=0.001, to=30, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dGIW(x, mu=3, sigma=5, nu=0.5), from=0.001, to=8, col="red", ylab="f(x)", las=1) ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pGIW(x, mu=3, sigma=5, nu=0.5), from=0.0001, to=14, col="red", las=1, ylab="F(x)") curve(pGIW(x, mu=3, sigma=5, nu=0.5, lower.tail=FALSE), from=0.0001, to=14, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qGIW(p, mu=3, sigma=5, nu=0.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pGIW(x, mu=3, sigma=5, nu=0.5), from=0, add=TRUE, col="red") ## The random function hist(rGIW(n=1000, mu=3, sigma=5, nu=0.5), freq=FALSE, xlab="x", ylim=c(0, 0.8), las=1, main="") curve(dGIW(x, mu=3, sigma=5, nu=0.5), from=0.001, to=14, add=TRUE, col="red") ## The Hazard function curve(hGIW(x, mu=3, sigma=5, nu=0.5), from=0.001, to=30, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
These functions define the density, distribution function, quantile
function and random generation for the Generalized Lindley Type II,
GL2(), distribution with parameters and .
dGL2(x, mu, sigma, log = FALSE) pGL2(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qGL2(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rGL2(n, mu, sigma) hGL2(x, mu = 0.5, sigma = 0.5)dGL2(x, mu, sigma, log = FALSE) pGL2(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qGL2(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rGL2(n, mu, sigma) hGL2(x, mu = 0.5, sigma = 0.5)
x, q
|
vector of positive quantiles. |
mu |
vector of the mu parameter. |
sigma |
vector of the sigma parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are
|
p |
vector of probabilities. |
n |
number of random values to return. |
The Generalized Lindley Type II distribution with parameters
and has support
and probability density function given by
for , and .
Note: in this implementation we changed the original parameters
for and for .
This reparameterization was performed to implement the distribution
within the GAMLSS framework.
The GL2 distribution is a flexible two-parameter extension of the classical Lindley distribution and is suitable for modeling positive lifetime and survival data.
dGL2 gives the density, pGL2 gives the distribution
function, qGL2 gives the quantile function, and
rGL2 generates random deviates.
Sofia Cadavid Rueda, [email protected]
Ekhosuehi, N., Opone, F., & Odobaire, F. (2018). A New Generalized Two Parameter Lindley Distribution. Journal of the Nigerian Statistical Association, 30, 547–566.
GL2.
# Example 1 # Plotting the mass function for different parameter values x_vals <- seq(0, 6, length.out = 500) # Calculate densities d1 <- dGL2(x_vals, mu = 0.7, sigma = 1.4) d2 <- dGL2(x_vals, mu = 0.3, sigma = 1.2) d3 <- dGL2(x_vals, mu = 3.0, sigma = 1.0) d4 <- dGL2(x_vals, mu = 6.0, sigma = 1.0) # Plot plot(x_vals, d1, type = "l", col = "red", lwd = 2, lty = 1, ylim = c(0, 5), xlim = c(0, 6), xlab = "x", ylab = "f(x)", main = "Probability Density Function of the GL2 Distribution", las = 1) lines(x_vals, d2, col = "black", lwd = 2, lty = 2) lines(x_vals, d3, col = "yellow", lwd = 2, lty = 1) lines(x_vals, d4, col = "green4", lwd = 2, lty = 1) # Legend legend("topright", col = c("red", "black", "yellow", "green4"), lwd = 2, lty = c(1, 2, 1, 1), legend = c(expression(paste(sigma, " = 1.4, ", mu, " = 0.7")), expression(paste(sigma, " = 1.2, ", mu, " = 0.3")), expression(paste(sigma, " = 1.0, ", mu, " = 3.0")), expression(paste(sigma, " = 1.0, ", mu, " = 6.0"))), bty = "n") # Example 2 # Checking if the cumulative curves converge to 1 curve(pGL2(x, mu=0.7, sigma=1.4), from=0.00001, to=40, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pGL2(x, mu=0.3, sigma=1.2), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.7, sigma=1.4", "mu=0.3, sigma=1.2"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qGL2(p, mu=3, sigma=1), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pGL2(x, mu=3, sigma=1), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function set.seed(123) x <- rGL2(5000, mu=0.7, sigma=1.4) hist(x, breaks=50, freq=FALSE, main="rGL2 vs theory density", xlab="x", col="lightblue", border="white") curve(dGL2(x, mu=0.7, sigma=1.4), add=TRUE, col="red", lwd=2) # Example 5 # The Hazard function curve(hGL2(x, mu=0.7, sigma=1.4), from=0.001, to=40, col="tomato", ylab="Hazard function", las=1)# Example 1 # Plotting the mass function for different parameter values x_vals <- seq(0, 6, length.out = 500) # Calculate densities d1 <- dGL2(x_vals, mu = 0.7, sigma = 1.4) d2 <- dGL2(x_vals, mu = 0.3, sigma = 1.2) d3 <- dGL2(x_vals, mu = 3.0, sigma = 1.0) d4 <- dGL2(x_vals, mu = 6.0, sigma = 1.0) # Plot plot(x_vals, d1, type = "l", col = "red", lwd = 2, lty = 1, ylim = c(0, 5), xlim = c(0, 6), xlab = "x", ylab = "f(x)", main = "Probability Density Function of the GL2 Distribution", las = 1) lines(x_vals, d2, col = "black", lwd = 2, lty = 2) lines(x_vals, d3, col = "yellow", lwd = 2, lty = 1) lines(x_vals, d4, col = "green4", lwd = 2, lty = 1) # Legend legend("topright", col = c("red", "black", "yellow", "green4"), lwd = 2, lty = c(1, 2, 1, 1), legend = c(expression(paste(sigma, " = 1.4, ", mu, " = 0.7")), expression(paste(sigma, " = 1.2, ", mu, " = 0.3")), expression(paste(sigma, " = 1.0, ", mu, " = 3.0")), expression(paste(sigma, " = 1.0, ", mu, " = 6.0"))), bty = "n") # Example 2 # Checking if the cumulative curves converge to 1 curve(pGL2(x, mu=0.7, sigma=1.4), from=0.00001, to=40, ylim=c(0, 1), col="royalblue1", lwd=2, main="Cumulative Distribution Function", xlab="x", ylab="F(x)") curve(pGL2(x, mu=0.3, sigma=1.2), col="tomato", lwd=2, add=TRUE) legend("bottomright", legend=c("mu=0.7, sigma=1.4", "mu=0.3, sigma=1.2"), col=c("royalblue1", "tomato", "seagreen"), lwd=2, cex=0.5) # Example 3 # The quantile function p <- seq(from=0, to=0.999, length.out=100) plot(x=qGL2(p, mu=3, sigma=1), y=p, xlab="Quantile", las=1, ylab="Probability", main="Quantile function ") curve(pGL2(x, mu=3, sigma=1), from=0, add=TRUE, col="tomato", lwd=2.5) # Example 4 # The random function set.seed(123) x <- rGL2(5000, mu=0.7, sigma=1.4) hist(x, breaks=50, freq=FALSE, main="rGL2 vs theory density", xlab="x", col="lightblue", border="white") curve(dGL2(x, mu=0.7, sigma=1.4), add=TRUE, col="red", lwd=2) # Example 5 # The Hazard function curve(hGL2(x, mu=0.7, sigma=1.4), from=0.001, to=40, col="tomato", ylab="Hazard function", las=1)
Density, distribution function, quantile function,
random generation and hazard function for the generalized
modified weibull distribution with parameters mu,
sigma, nu and tau.
dGMW(x, mu, sigma, nu, tau, log = FALSE) pGMW(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qGMW(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rGMW(n, mu, sigma, nu, tau) hGMW(x, mu, sigma, nu, tau, log = FALSE)dGMW(x, mu, sigma, nu, tau, log = FALSE) pGMW(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qGMW(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rGMW(n, mu, sigma, nu, tau) hGMW(x, mu, sigma, nu, tau, log = FALSE)
x, q
|
vector of quantiles. |
mu |
scale parameter. |
sigma |
shape parameter. |
nu |
shape parameter. |
tau |
acceleration parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The generalized modified weibull with parameters mu,
sigma, nu and tau has density given by
for .
dGMW gives the density, pGMW gives the distribution
function, qGMW gives the quantile function, rGMW
generates random deviates and hGMW gives the hazard function.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, to=0.8, ylim=c(0, 2), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, to=1.2, col="red", las=1, ylab="F(x)") curve(pGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5, lower.tail=FALSE), from=0, to=1.2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qGMW(p, mu=2, sigma=0.5, nu=2, tau=1.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, add=TRUE, col="red") ## The random function hist(rGMW(n=1000, mu=2, sigma=0.5, nu=2,tau=1.5), freq=FALSE, xlab="x", main ="", las=1) curve(dGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, to=1, ylim=c(0, 16), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, to=0.8, ylim=c(0, 2), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, to=1.2, col="red", las=1, ylab="F(x)") curve(pGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5, lower.tail=FALSE), from=0, to=1.2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qGMW(p, mu=2, sigma=0.5, nu=2, tau=1.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, add=TRUE, col="red") ## The random function hist(rGMW(n=1000, mu=2, sigma=0.5, nu=2,tau=1.5), freq=FALSE, xlab="x", main ="", las=1) curve(dGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hGMW(x, mu=2, sigma=0.5, nu=2, tau=1.5), from=0, to=1, ylim=c(0, 16), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function, random generation and
hazard function for the generalized Weibull distribution with parameters
mu, sigma and nu.
dGWF(x, mu, sigma, nu, log = FALSE) pGWF(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGWF(p, mu, sigma, nu) rGWF(n, mu, sigma, nu) hGWF(x, mu, sigma, nu)dGWF(x, mu, sigma, nu, log = FALSE) pGWF(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qGWF(p, mu, sigma, nu) rGWF(n, mu, sigma, nu) hGWF(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter one. |
sigma |
parameter two. |
nu |
parameter three. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The generalized Weibull with parameters mu, sigma and
nu has density given by
for , , and .
dGWF gives the density, pGWF gives the distribution
function, qGWF gives the quantile function, rGWF
generates random deviates and hGWF gives the hazard function.
Jaime Mosquera, [email protected]
Mudholkar, G. S., & Kollia, G. D. (1994). Generalized Weibull family: a structural analysis. Communications in statistics-theory and methods, 23(4), 1149-1171.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve( dGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, to = 5, col = "red", las = 1, ylab = "f(x)" ) ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve( pGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)" ) curve( pGWF( x, mu = 5, sigma = 2, nu = -0.2, lower.tail = FALSE ), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)" ) ## The quantile function p <- seq(from = 0, to = 0.999, length.out = 100) plot( x = qGWF(p, mu = 5, sigma = 2, nu = -0.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability" ) curve( pGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, add = TRUE, col = "red" ) ## The random function hist( rGWF(n = 10000, mu = 5, sigma = 2, nu = -0.2), freq = FALSE, xlab = "x", las = 1, main = "", ylim = c(0, 2.0) ) curve(dGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, add = TRUE, col = "red" ) ## The Hazard function par(mfrow = c(1, 1)) curve( hGWF(x, mu = 0.003, sigma = 5e-6, nu = 0.025), from = 0, to = 250, col = "red", ylab = "Hazard function", las = 1 ) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve( dGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, to = 5, col = "red", las = 1, ylab = "f(x)" ) ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve( pGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)" ) curve( pGWF( x, mu = 5, sigma = 2, nu = -0.2, lower.tail = FALSE ), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)" ) ## The quantile function p <- seq(from = 0, to = 0.999, length.out = 100) plot( x = qGWF(p, mu = 5, sigma = 2, nu = -0.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability" ) curve( pGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, add = TRUE, col = "red" ) ## The random function hist( rGWF(n = 10000, mu = 5, sigma = 2, nu = -0.2), freq = FALSE, xlab = "x", las = 1, main = "", ylim = c(0, 2.0) ) curve(dGWF(x, mu = 5, sigma = 2, nu = -0.2), from = 0, add = TRUE, col = "red" ) ## The Hazard function par(mfrow = c(1, 1)) curve( hGWF(x, mu = 0.003, sigma = 5e-6, nu = 0.025), from = 0, to = 250, col = "red", ylab = "Hazard function", las = 1 ) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the inverse weibull distribution with
parameters mu and sigma.
dIW(x, mu, sigma, log = FALSE) pIW(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qIW(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rIW(n, mu, sigma) hIW(x, mu, sigma)dIW(x, mu, sigma, log = FALSE) pIW(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qIW(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rIW(n, mu, sigma) hIW(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
scale parameter. |
sigma |
shape parameters. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The inverse weibull distribution with parameters mu and
sigma has density given by
for , and
dIW gives the density, pIW gives the distribution
function, qIW gives the quantile function, rIW
generates random deviates and hIW gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Drapella, A. (1993). The complementary Weibull distribution: unknown or just forgotten?. Quality and reliability engineering international, 9(4), 383-385.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dIW(x, mu=5, sigma=2.5), from=0, to=10, ylim=c(0, 0.55), col="red", las=1, ylab="f(x)") #' ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pIW(x, mu=5, sigma=2.5), from=0, to=10, col="red", las=1, ylab="F(x)") curve(pIW(x, mu=5, sigma=2.5, lower.tail=FALSE), from=0, to=10, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qIW(p, mu=5, sigma=2.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pIW(x, mu=5, sigma=2.5), from=0, add=TRUE, col="red") ## The random function hist(rIW(n=10000, mu=5, sigma=2.5), freq=FALSE, xlim=c(0,60), xlab="x", las=1, main="") curve(dIW(x, mu=5, sigma=2.5), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hIW(x, mu=5, sigma=2.5), from=0, to=15, ylim=c(0, 0.9), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dIW(x, mu=5, sigma=2.5), from=0, to=10, ylim=c(0, 0.55), col="red", las=1, ylab="f(x)") #' ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pIW(x, mu=5, sigma=2.5), from=0, to=10, col="red", las=1, ylab="F(x)") curve(pIW(x, mu=5, sigma=2.5, lower.tail=FALSE), from=0, to=10, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qIW(p, mu=5, sigma=2.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pIW(x, mu=5, sigma=2.5), from=0, add=TRUE, col="red") ## The random function hist(rIW(n=10000, mu=5, sigma=2.5), freq=FALSE, xlim=c(0,60), xlab="x", las=1, main="") curve(dIW(x, mu=5, sigma=2.5), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hIW(x, mu=5, sigma=2.5), from=0, to=15, ylim=c(0, 0.9), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Kumaraswamy Inverse Weibull distribution
with parameters mu, sigma and nu.
dKumIW(x, mu, sigma, nu, log = FALSE) pKumIW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qKumIW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rKumIW(n, mu, sigma, nu) hKumIW(x, mu, sigma, nu)dKumIW(x, mu, sigma, nu, log = FALSE) pKumIW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qKumIW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rKumIW(n, mu, sigma, nu) hKumIW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Kumaraswamy Inverse Weibull Distribution with parameters mu,
sigma and nu has density given by
for , , and .
dKumIW gives the density, pKumIW gives the distribution
function, qKumIW gives the quantile function, rKumIW
generates random deviates and hKumIW gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Shahbaz, M. Q., Shahbaz, S., & Butt, N. S. (2012). The Kumaraswamy Inverse Weibull Distribution. Pakistan journal of statistics and operation research, 479-489.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow = c(1, 1)) curve(dKumIW(x, mu = 1.5, sigma= 1.5, nu = 1), from = 0, to = 8.5, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pKumIW(x, mu = 1.5, sigma= 1.5, nu = 1), from = 0, to = 8.5, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pKumIW(x, mu = 1.5, sigma= 1.5, nu = 1, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qKumIW(p=p, mu = 1.5, sigma= 1.5, nu = 10), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pKumIW(x, mu = 1.5, sigma= 1.5, nu = 10), from = 0, add = TRUE, col = "red") ## The random function hist(rKumIW(1000, mu = 1.5, sigma= 1.5, nu = 5), freq = FALSE, xlab = "x", las = 1, ylim = c(0, 1.5), main = "") curve(dKumIW(x, mu = 1.5, sigma= 1.5, nu = 5), from = 0, to =8, add = TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hKumIW(x, mu = 1.5, sigma= 1.5, nu = 1), from = 0, to = 3, ylim = c(0, 0.7), col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow = c(1, 1)) curve(dKumIW(x, mu = 1.5, sigma= 1.5, nu = 1), from = 0, to = 8.5, col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pKumIW(x, mu = 1.5, sigma= 1.5, nu = 1), from = 0, to = 8.5, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pKumIW(x, mu = 1.5, sigma= 1.5, nu = 1, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qKumIW(p=p, mu = 1.5, sigma= 1.5, nu = 10), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pKumIW(x, mu = 1.5, sigma= 1.5, nu = 10), from = 0, add = TRUE, col = "red") ## The random function hist(rKumIW(1000, mu = 1.5, sigma= 1.5, nu = 5), freq = FALSE, xlab = "x", las = 1, ylim = c(0, 1.5), main = "") curve(dKumIW(x, mu = 1.5, sigma= 1.5, nu = 5), from = 0, to =8, add = TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hKumIW(x, mu = 1.5, sigma= 1.5, nu = 1), from = 0, to = 3, ylim = c(0, 0.7), col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Lindley distribution
with parameter mu.
dLIN(x, mu, log = FALSE) pLIN(q, mu, lower.tail = TRUE, log.p = FALSE) qLIN(p, mu, lower.tail = TRUE, log.p = FALSE) rLIN(n, mu) hLIN(x, mu, log = FALSE)dLIN(x, mu, log = FALSE) pLIN(q, mu, lower.tail = TRUE, log.p = FALSE) qLIN(p, mu, lower.tail = TRUE, log.p = FALSE) rLIN(n, mu) hLIN(x, mu, log = FALSE)
x, q
|
vector of quantiles. |
mu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
Lindley Distribution with parameter mu has density given by
for and . These function were taken form LindleyR package.
dLIN gives the density, pLIN gives the distribution
function, qLIN gives the quantile function, rLIN
generates random deviates and hLIN gives the hazard function.
Freddy Hernandez, [email protected]
Lindley, D. V. (1958). Fiducial distributions and Bayes' theorem. Journal of the Royal Statistical Society. Series B (Methodological), 102-107.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dLIN(x, mu=1.5), from=0.0001, to=10, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pLIN(x, mu=2), from=0.0001, to=10, col="red", las=1, ylab="F(x)") curve(pLIN(x, mu=2, lower.tail=FALSE), from=0.0001, to=10, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qLIN(p, mu=2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pLIN(x, mu=2), from=0, add=TRUE, col="red") ## The random function hist(rLIN(n=10000, mu=2), freq=FALSE, xlab="x", las=1, main="") curve(dLIN(x, mu=2), from=0.09, to=5, add=TRUE, col="red") ## The Hazard function curve(hLIN(x, mu=2), from=0.001, to=10, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dLIN(x, mu=1.5), from=0.0001, to=10, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pLIN(x, mu=2), from=0.0001, to=10, col="red", las=1, ylab="F(x)") curve(pLIN(x, mu=2, lower.tail=FALSE), from=0.0001, to=10, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qLIN(p, mu=2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pLIN(x, mu=2), from=0, add=TRUE, col="red") ## The random function hist(rLIN(n=10000, mu=2), freq=FALSE, xlab="x", las=1, main="") curve(dLIN(x, mu=2), from=0.09, to=5, add=TRUE, col="red") ## The Hazard function curve(hLIN(x, mu=2), from=0.001, to=10, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Log-Weibull distribution
with parameters mu and sigma.
dLW(x, mu, sigma, log = FALSE) pLW(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qLW(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rLW(n, mu, sigma) hLW(x, mu, sigma)dLW(x, mu, sigma, log = FALSE) pLW(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qLW(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rLW(n, mu, sigma) hLW(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Log-Weibull Distribution with parameters mu
and sigma has density given by
for .
dLW gives the density, pLW gives the distribution
function, qLW gives the quantile function, rLW
generates random deviates and hLW gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Gumbel, E. J. (1958). Statistics of extremes. Columbia university press.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dLW(x, mu=0, sigma=1.5), from=-8, to=5, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pLW(x, mu=0, sigma=1.5), from=-8, to=5, col="red", las=1, ylab="F(x)") curve(pLW(x, mu=0, sigma=1.5, lower.tail=FALSE), from=-8, to=5, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qLW(p, mu=0, sigma=1.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pLW(x, mu=0, sigma=1.5), from=-8, to=5, add=TRUE, col="red") ## The random function hist(rLW(n=10000, mu=0, sigma=1.5), freq=FALSE, xlab="x", las=1, main="") curve(dLW(x, mu=0, sigma=1.5), from=-15, to=6, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hLW(x, mu=0, sigma=1.5), from=-8, to=7, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dLW(x, mu=0, sigma=1.5), from=-8, to=5, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pLW(x, mu=0, sigma=1.5), from=-8, to=5, col="red", las=1, ylab="F(x)") curve(pLW(x, mu=0, sigma=1.5, lower.tail=FALSE), from=-8, to=5, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qLW(p, mu=0, sigma=1.5), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pLW(x, mu=0, sigma=1.5), from=-8, to=5, add=TRUE, col="red") ## The random function hist(rLW(n=10000, mu=0, sigma=1.5), freq=FALSE, xlab="x", las=1, main="") curve(dLW(x, mu=0, sigma=1.5), from=-15, to=6, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hLW(x, mu=0, sigma=1.5), from=-8, to=7, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Marshall-Olkin Extended Inverse Weibull distribution
with parameters mu, sigma and nu.
dMOEIW(x, mu, sigma, nu, log = FALSE) pMOEIW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qMOEIW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rMOEIW(n, mu, sigma, nu) hMOEIW(x, mu, sigma, nu)dMOEIW(x, mu, sigma, nu, log = FALSE) pMOEIW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qMOEIW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rMOEIW(n, mu, sigma, nu) hMOEIW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Marshall-Olkin Extended Inverse Weibull distribution mu,
sigma and nu has density given by
for .
dMOEIW gives the density, pMOEIW gives the distribution
function, qMOEIW gives the quantile function, rMOEIW
generates random deviates and hMOEIW gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Okasha, H. M., El-Baz, A. H., Tarabia, A. M. K., & Basheer, A. M. (2017). Extended inverse Weibull distribution with reliability application. Journal of the Egyptian Mathematical Society, 25(3), 343-349.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0, to=2, col="red", ylab="f(x)", las=1) ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pMOEIW(x, mu=0.6, sigma=1.7, nu=0.3, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qMOEIW(p, mu=0.6, sigma=1.7, nu=0.3), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0, add=TRUE, col="red") ## The random function hist(rMOEIW(n=1000, mu=0.6, sigma=1.7, nu=0.3), freq=FALSE, xlab="x", las=1, main="") curve(dMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0.001, to=4, add=TRUE, col="red") ## The Hazard function curve(hMOEIW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=3, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0, to=2, col="red", ylab="f(x)", las=1) ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pMOEIW(x, mu=0.6, sigma=1.7, nu=0.3, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qMOEIW(p, mu=0.6, sigma=1.7, nu=0.3), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0, add=TRUE, col="red") ## The random function hist(rMOEIW(n=1000, mu=0.6, sigma=1.7, nu=0.3), freq=FALSE, xlab="x", las=1, main="") curve(dMOEIW(x, mu=0.6, sigma=1.7, nu=0.3), from=0.001, to=4, add=TRUE, col="red") ## The Hazard function curve(hMOEIW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=3, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Marshall-Olkin Extended Weibull distribution
with parameters mu, sigma and nu.
dMOEW(x, mu, sigma, nu, log = FALSE) pMOEW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qMOEW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rMOEW(n, mu, sigma, nu) hMOEW(x, mu, sigma, nu)dMOEW(x, mu, sigma, nu, log = FALSE) pMOEW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qMOEW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rMOEW(n, mu, sigma, nu) hMOEW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Marshall-Olkin Extended Weibull distribution mu,
sigma and nu has density given by
for .
dMOEW gives the density, pMOEW gives the distribution
function, qMOEW gives the quantile function, rMOEW
generates random deviates and hMOEW gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Ghitany, M. E., Al-Hussaini, E. K., & Al-Jarallah, R. A. (2005). Marshall–Olkin extended Weibull distribution and its application to censored data. Journal of Applied Statistics, 32(10), 1025-1034.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=1, col="red", ylab="f(x)", las=1) ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pMOEW(x, mu=0.5, sigma=0.7, nu=1, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qMOEW(p, mu=0.5, sigma=0.7, nu=1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0, add=TRUE, col="red") ## The random function hist(rMOEW(n=100, mu=0.5, sigma=0.7, nu=1), freq=FALSE, xlab="x", ylim=c(0, 1), las=1, main="") curve(dMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=2, add=TRUE, col="red") ## The Hazard function curve(hMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=3, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=1, col="red", ylab="f(x)", las=1) ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pMOEW(x, mu=0.5, sigma=0.7, nu=1, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qMOEW(p, mu=0.5, sigma=0.7, nu=1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0, add=TRUE, col="red") ## The random function hist(rMOEW(n=100, mu=0.5, sigma=0.7, nu=1), freq=FALSE, xlab="x", ylim=c(0, 1), las=1, main="") curve(dMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=2, add=TRUE, col="red") ## The Hazard function curve(hMOEW(x, mu=0.5, sigma=0.7, nu=1), from=0.001, to=3, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Desnsity, distribution function, quantile function,
random generation and hazard function for the Marshall-Olkin Kappa distribution
with parameters mu, sigma, nu and tau.
dMOK(x, mu, sigma, nu, tau, log = FALSE) pMOK(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qMOK(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rMOK(n, mu, sigma, nu, tau) hMOK(x, mu, sigma, nu, tau)dMOK(x, mu, sigma, nu, tau, log = FALSE) pMOK(q, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) qMOK(p, mu, sigma, nu, tau, lower.tail = TRUE, log.p = FALSE) rMOK(n, mu, sigma, nu, tau) hMOK(x, mu, sigma, nu, tau)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
tau |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Marshall-Olkin Kappa distribution with parameters mu,
sigma, nu and tau has density given by:
for .
dMOK gives the density, pMOK gives the distribution function,
qMOK gives the quantile function, rMOK generates random deviates
and hMOK gives the hazard function.
Angel Muñoz,
Javed, M., Nawaz, T., & Irfan, M. (2019). The Marshall-Olkin kappa distribution: properties and applications. Journal of King Saud University-Science, 31(4), 684-691.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow = c(1,1)) curve(dMOK(x = x, mu = 1, sigma = 3.5, nu = 3, tau = 2), from = 0, to = 15, ylab = 'f(x)', col = 2, las = 1) ## The cumulative distribution and the Reliability function par(mfrow = c(1,2)) curve(pMOK(q = x, mu = 1, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 10, col = 2, lwd = 2, las = 1, ylab = 'F(x)') curve(pMOK(q = x, mu = 1, sigma = 2.5, nu = 3, tau = 2, lower.tail = FALSE), from = 0, to = 10, col = 2, lwd = 2, las = 1, ylab = 'R(x)') ## The quantile function p <- seq(from = 0.00001, to = 0.99999, length.out = 100) plot(x = qMOK(p = p, mu = 4, sigma = 2.5, nu = 3, tau = 2), y = p, xlab = 'Quantile', las = 1, ylab = 'Probability') curve(pMOK(q = x, mu = 4, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 15, add = TRUE, col = 2) ## The random function hist(rMOK(n = 10000, mu = 1, sigma = 2.5, nu = 3, tau = 2), freq = FALSE, xlab = "x", las = 1, main = '', ylim = c(0,.3), xlim = c(0,20), breaks = 50) curve(dMOK(x, mu = 1, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 15, add = TRUE, col = 2) ## The Hazard function par(mfrow = c(1,1)) curve(hMOK(x = x, mu = 1, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 20, col = 2, ylab = 'Hazard function', las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function par(mfrow = c(1,1)) curve(dMOK(x = x, mu = 1, sigma = 3.5, nu = 3, tau = 2), from = 0, to = 15, ylab = 'f(x)', col = 2, las = 1) ## The cumulative distribution and the Reliability function par(mfrow = c(1,2)) curve(pMOK(q = x, mu = 1, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 10, col = 2, lwd = 2, las = 1, ylab = 'F(x)') curve(pMOK(q = x, mu = 1, sigma = 2.5, nu = 3, tau = 2, lower.tail = FALSE), from = 0, to = 10, col = 2, lwd = 2, las = 1, ylab = 'R(x)') ## The quantile function p <- seq(from = 0.00001, to = 0.99999, length.out = 100) plot(x = qMOK(p = p, mu = 4, sigma = 2.5, nu = 3, tau = 2), y = p, xlab = 'Quantile', las = 1, ylab = 'Probability') curve(pMOK(q = x, mu = 4, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 15, add = TRUE, col = 2) ## The random function hist(rMOK(n = 10000, mu = 1, sigma = 2.5, nu = 3, tau = 2), freq = FALSE, xlab = "x", las = 1, main = '', ylim = c(0,.3), xlim = c(0,20), breaks = 50) curve(dMOK(x, mu = 1, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 15, add = TRUE, col = 2) ## The Hazard function par(mfrow = c(1,1)) curve(hMOK(x = x, mu = 1, sigma = 2.5, nu = 3, tau = 2), from = 0, to = 20, col = 2, ylab = 'Hazard function', las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the modified weibull distribution
with parameters mu, sigma and nu.
dMW(x, mu, sigma, nu, log = FALSE) pMW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qMW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rMW(n, mu, sigma, nu) hMW(x, mu, sigma, nu)dMW(x, mu, sigma, nu, log = FALSE) pMW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qMW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rMW(n, mu, sigma, nu) hMW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
shape parameter one. |
sigma |
parameter two. |
nu |
scale parameter three. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The modified weibull distribution with parameters mu, sigma
and nu has density given by
for , , and .
dMW gives the density, pMW gives the distribution
function, qMW gives the quantile function, rMW
generates random deviates and hMW gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Lai, C. D., Xie, M., & Murthy, D. N. P. (2003). A modified Weibull distribution. IEEE Transactions on reliability, 52(1), 33-37.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dMW(x, mu=2, sigma=1.5, nu=0.2), from=0, to=2, ylim=c(0, 1.5), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pMW(x, mu=2, sigma=1.5, nu=0.2), from=0, to=2, col = "red", las=1, ylab="F(x)") curve(pMW(x, mu=2, sigma=1.5, nu=0.2, lower.tail = FALSE), from=0, to=2, col="red", las=1, ylab ="R(x)") ## The quantile function p <- seq(from=0, to=0.9999, length.out=100) plot(x=qMW(p, mu=2, sigma=1.5, nu=0.2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pMW(x, mu=2, sigma=1.5, nu=0.2), from=0, add=TRUE, col="red") ## The random function hist(rMW(n=1000, mu=2, sigma=1.5, nu=0.2), freq=FALSE, xlab="x", las=1, main="") curve(dMW(x, mu=2, sigma=1.5, nu=0.2), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hMW(x, mu=2, sigma=1.5, nu=0.2), from=0, to=1.5, ylim=c(0, 5), col="red", las=1, ylab="H(x)", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dMW(x, mu=2, sigma=1.5, nu=0.2), from=0, to=2, ylim=c(0, 1.5), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pMW(x, mu=2, sigma=1.5, nu=0.2), from=0, to=2, col = "red", las=1, ylab="F(x)") curve(pMW(x, mu=2, sigma=1.5, nu=0.2, lower.tail = FALSE), from=0, to=2, col="red", las=1, ylab ="R(x)") ## The quantile function p <- seq(from=0, to=0.9999, length.out=100) plot(x=qMW(p, mu=2, sigma=1.5, nu=0.2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pMW(x, mu=2, sigma=1.5, nu=0.2), from=0, add=TRUE, col="red") ## The random function hist(rMW(n=1000, mu=2, sigma=1.5, nu=0.2), freq=FALSE, xlab="x", las=1, main="") curve(dMW(x, mu=2, sigma=1.5, nu=0.2), from=0, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hMW(x, mu=2, sigma=1.5, nu=0.2), from=0, to=1.5, ylim=c(0, 5), col="red", las=1, ylab="H(x)", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the two-parameter
New Exponentiated Exponential with
parameters mu and sigma.
dNEE(x, mu = 1, sigma = 1, log = FALSE) pNEE(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) qNEE(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) rNEE(n = 1, mu = 1, sigma = 1) hNEE(x, mu, sigma, log = FALSE)dNEE(x, mu = 1, sigma = 1, log = FALSE) pNEE(q, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) qNEE(p, mu = 1, sigma = 1, lower.tail = TRUE, log.p = FALSE) rNEE(n = 1, mu = 1, sigma = 1) hNEE(x, mu, sigma, log = FALSE)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are
|
p |
vector of probabilities. |
n |
number of observations. |
The New Exponentiated Exponential distribution with parameters mu
and sigma has density given by
for , and .
Note: In this implementation we changed the original parameters
for and for ,
we did it to implement this distribution within gamlss framework.
dNEE gives the density, pNEE gives the distribution
function, qNEE gives the quantile function, rNEE
generates random deviates and hNEE gives the hazard function.
Juliana Garcia, [email protected]
Hassan, Anwar, I. H. Dar, and M. A. Lone. "A New Class of Probability Distributions With An Application to Engineering Data." Pakistan Journal of Statistics and Operation Research 20.2 (2024): 217-231.
# Example 1 # Plotting the mass function for different parameter values curve(dNEE(x, mu=0.2, sigma=0.3), from=0, to=8, col="cadetblue3", las=1, ylab="f(x)") curve(dNEE(x, mu=1, sigma=4), add=TRUE, col= "purple") curve(dNEE(x, mu=1.5, sigma=22), add=TRUE, col="goldenrod") curve(dNEE(x, mu=0.5, sigma=2), add=TRUE, col="green3") legend("topright", col=c("cadetblue3", "purple", "goldenrod", "green3"), lty=1, bty="n", legend=c("mu=0.2, sigma=0.3", "mu=1.0, sigma=4", "mu=1.5, sigma=22", "mu=0.5, sigma=2")) # Example 2 # Checking if the cumulative curves converge to 1 curve(pNEE(x, mu=0.2, sigma=0.3), ylim=c(0, 1), from=0, to=8, col="cadetblue3", las=1, ylab="F(x)") curve(pNEE(x, mu=1, sigma=4), add=TRUE, col= "purple") curve(pNEE(x, mu=1.5, sigma=22), add=TRUE, col="goldenrod") curve(pNEE(x, mu=0.5, sigma=2), add=TRUE, col="green3") legend("bottomright", col=c("cadetblue3", "purple", "goldenrod", "green3"), lty=1, bty="n", legend=c("mu=0.2, sigma=0.3", "mu=1.0, sigma=4", "mu=1.5, sigma=22", "mu=0.5, sigma=2")) # Example 3 # Checking the quantile function mu <- 0.5 sigma <- 2 p <- seq(from=0, to=0.999, length.out=100) plot(x=qNEE(p, mu=mu, sigma=sigma), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pNEE(x, mu=mu, sigma=sigma), from=0, add=TRUE, col="red") # Example 4 # Comparing the random generator output with # the theoretical probabilities mu <- 0.5 sigma <- 2 x <- rNEE(n=10000, mu=mu, sigma=sigma) hist(x, freq=FALSE) curve(dNEE(x, mu=mu, sigma=sigma), col="tomato", add=TRUE)# Example 1 # Plotting the mass function for different parameter values curve(dNEE(x, mu=0.2, sigma=0.3), from=0, to=8, col="cadetblue3", las=1, ylab="f(x)") curve(dNEE(x, mu=1, sigma=4), add=TRUE, col= "purple") curve(dNEE(x, mu=1.5, sigma=22), add=TRUE, col="goldenrod") curve(dNEE(x, mu=0.5, sigma=2), add=TRUE, col="green3") legend("topright", col=c("cadetblue3", "purple", "goldenrod", "green3"), lty=1, bty="n", legend=c("mu=0.2, sigma=0.3", "mu=1.0, sigma=4", "mu=1.5, sigma=22", "mu=0.5, sigma=2")) # Example 2 # Checking if the cumulative curves converge to 1 curve(pNEE(x, mu=0.2, sigma=0.3), ylim=c(0, 1), from=0, to=8, col="cadetblue3", las=1, ylab="F(x)") curve(pNEE(x, mu=1, sigma=4), add=TRUE, col= "purple") curve(pNEE(x, mu=1.5, sigma=22), add=TRUE, col="goldenrod") curve(pNEE(x, mu=0.5, sigma=2), add=TRUE, col="green3") legend("bottomright", col=c("cadetblue3", "purple", "goldenrod", "green3"), lty=1, bty="n", legend=c("mu=0.2, sigma=0.3", "mu=1.0, sigma=4", "mu=1.5, sigma=22", "mu=0.5, sigma=2")) # Example 3 # Checking the quantile function mu <- 0.5 sigma <- 2 p <- seq(from=0, to=0.999, length.out=100) plot(x=qNEE(p, mu=mu, sigma=sigma), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pNEE(x, mu=mu, sigma=sigma), from=0, add=TRUE, col="red") # Example 4 # Comparing the random generator output with # the theoretical probabilities mu <- 0.5 sigma <- 2 x <- rNEE(n=10000, mu=mu, sigma=sigma) hist(x, freq=FALSE) curve(dNEE(x, mu=mu, sigma=sigma), col="tomato", add=TRUE)
Density, distribution function, quantile function,
random generation and hazard function for the Odd Weibull distribution with
parameters mu, sigma and nu.
dOW(x, mu, sigma, nu, log = FALSE) pOW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qOW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rOW(n, mu, sigma, nu) hOW(x, mu, sigma, nu)dOW(x, mu, sigma, nu, log = FALSE) pOW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qOW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rOW(n, mu, sigma, nu) hOW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter one. |
sigma |
parameter two. |
nu |
parameter three. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[T <= t], otherwise, P[T > t]. |
p |
vector of probabilities. |
n |
number of observations. |
The Odd Weibull with parameters mu, sigma
and nu has density given by
for .
dOW gives the density, pOW gives the distribution
function, qOW gives the quantile function, rOW
generates random deviates and hOW gives the hazard function.
Jaime Mosquera Gutiérrez [email protected]
Cooray, K. (2006). Generalization of the Weibull distribution: the odd Weibull family. Statistical Modelling, 6(3), 265-277.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dOW(x, mu=2, sigma=3, nu=0.2), from=0, to=4, ylim=c(0, 2), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pOW(x, mu=2, sigma=3, nu=0.2), from=0, to=4, ylim=c(0, 1), col="red", las=1, ylab="F(x)") curve(pOW(x, mu=2, sigma=3, nu=0.2, lower.tail=FALSE), from=0, to=4, ylim=c(0, 1), col="red", las=1, ylab = "R(x)") ## The quantile function p <- seq(from=0, to=0.998, length.out=100) plot(x = qOW(p, mu=2, sigma=3, nu=0.2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pOW(x, mu=2, sigma=3, nu=0.2), from=0, add=TRUE, col="red") ## The random function hist(rOW(n=10000, mu=2, sigma = 3, nu = 0.2), freq=FALSE, ylim = c(0, 2), xlab = "x", las = 1, main = "") curve(dOW(x, mu=2, sigma=3, nu=0.2), from=0, ylim=c(0, 2), add=TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hOW(x, mu=2, sigma=3, nu=0.2), from=0, to=2.5, ylim=c(0, 3), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dOW(x, mu=2, sigma=3, nu=0.2), from=0, to=4, ylim=c(0, 2), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pOW(x, mu=2, sigma=3, nu=0.2), from=0, to=4, ylim=c(0, 1), col="red", las=1, ylab="F(x)") curve(pOW(x, mu=2, sigma=3, nu=0.2, lower.tail=FALSE), from=0, to=4, ylim=c(0, 1), col="red", las=1, ylab = "R(x)") ## The quantile function p <- seq(from=0, to=0.998, length.out=100) plot(x = qOW(p, mu=2, sigma=3, nu=0.2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pOW(x, mu=2, sigma=3, nu=0.2), from=0, add=TRUE, col="red") ## The random function hist(rOW(n=10000, mu=2, sigma = 3, nu = 0.2), freq=FALSE, ylim = c(0, 2), xlab = "x", las = 1, main = "") curve(dOW(x, mu=2, sigma=3, nu=0.2), from=0, ylim=c(0, 2), add=TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hOW(x, mu=2, sigma=3, nu=0.2), from=0, to=2.5, ylim=c(0, 3), col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Power Lindley distribution
with parameters mu and sigma.
dPL(x, mu, sigma, log = FALSE) pPL(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qPL(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rPL(n, mu, sigma) hPL(x, mu, sigma)dPL(x, mu, sigma, log = FALSE) pPL(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qPL(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rPL(n, mu, sigma) hPL(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Power Lindley Distribution with parameters mu
and sigma has density given by
for .
dPL gives the density, pPL gives the distribution
function, qPL gives the quantile function, rPL
generates random deviates and hPL gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Ghitany, M. E., Al-Mutairi, D. K., Balakrishnan, N., & Al-Enezi, L. J. (2013). Power Lindley distribution and associated inference. Computational Statistics & Data Analysis, 64, 20-33.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dPL(x, mu=1.5, sigma=0.2), from=0.1, to=10, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pPL(x, mu=1.5, sigma=0.2), from=0.1, to=10, col="red", las=1, ylab="F(x)") curve(pPL(x, mu=1.5, sigma=0.2, lower.tail=FALSE), from=0.1, to=10, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qPL(p, mu=1.5, sigma=0.2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pPL(x, mu=1.5, sigma=0.2), from=0.1, add=TRUE, col="red") ## The random function hist(rPL(n=1000, mu=1.5, sigma=0.2), freq=FALSE, xlab="x", las=1, main="") curve(dPL(x, mu=1.5, sigma=0.2), from=0.1, to=15, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hPL(x, mu=1.5, sigma=0.2), from=0.1, to=15, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dPL(x, mu=1.5, sigma=0.2), from=0.1, to=10, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pPL(x, mu=1.5, sigma=0.2), from=0.1, to=10, col="red", las=1, ylab="F(x)") curve(pPL(x, mu=1.5, sigma=0.2, lower.tail=FALSE), from=0.1, to=10, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qPL(p, mu=1.5, sigma=0.2), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pPL(x, mu=1.5, sigma=0.2), from=0.1, add=TRUE, col="red") ## The random function hist(rPL(n=1000, mu=1.5, sigma=0.2), freq=FALSE, xlab="x", las=1, main="") curve(dPL(x, mu=1.5, sigma=0.2), from=0.1, to=15, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hPL(x, mu=1.5, sigma=0.2), from=0.1, to=15, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function,quantile function,
random generation and hazard function for the Quasi XGamma Poisson distribution
with parameters mu, sigma and nu.
dQXGP(x, mu, sigma, nu, log = FALSE) pQXGP(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qQXGP(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rQXGP(n, mu, sigma, nu) hQXGP(x, mu, sigma, nu)dQXGP(x, mu, sigma, nu, log = FALSE) pQXGP(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qQXGP(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rQXGP(n, mu, sigma, nu) hQXGP(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Quasi XGamma Poisson distribution with parameters mu,
sigma and nu has density given by:
for , , , .
where
dQXGP gives the density, pQXGP gives the distribution
function, qQXGP gives the quantile function, rQXGP
generates random deviates and hQXGP gives the hazard function.
Simon Zapata
Sen, S., Korkmaz, M. Ç., & Yousof, H. M. (2018). The quasi XGamma-Poisson distribution: properties and application. Istatistik Journal of The Turkish Statistical Association, 11(3), 65-76.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dQXGP(x, mu=0.5, sigma=1, nu=1), from=0.1, to=8, ylim=c(0, 0.6), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pQXGP(x, mu=0.5, sigma=1, nu=1), from=0.1, to=8, col="red", las=1, ylab="F(x)") curve(pQXGP(x, mu=0.5, sigma=1, nu=1, lower.tail=FALSE), from=0.1, to=8, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qQXGP(p, mu=0.5, sigma=1, nu=1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pQXGP(x, mu=0.5, sigma=1, nu=1), from=0.1, add=TRUE, col="red") ## The random function hist(rQXGP(n=1000, mu=0.5, sigma=1, nu=1), freq=FALSE, xlab="x", ylim=c(0, 0.4), las=1, main="", xlim=c(0, 15)) curve(dQXGP(x, mu=0.5, sigma=1, nu=1), from=0.001, to=500, add=TRUE, col="red") ## The Hazard function curve(hQXGP(x, mu=0.5, sigma=1, nu=1), from=0.01, to=3, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dQXGP(x, mu=0.5, sigma=1, nu=1), from=0.1, to=8, ylim=c(0, 0.6), col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pQXGP(x, mu=0.5, sigma=1, nu=1), from=0.1, to=8, col="red", las=1, ylab="F(x)") curve(pQXGP(x, mu=0.5, sigma=1, nu=1, lower.tail=FALSE), from=0.1, to=8, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qQXGP(p, mu=0.5, sigma=1, nu=1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pQXGP(x, mu=0.5, sigma=1, nu=1), from=0.1, add=TRUE, col="red") ## The random function hist(rQXGP(n=1000, mu=0.5, sigma=1, nu=1), freq=FALSE, xlab="x", ylim=c(0, 0.4), las=1, main="", xlim=c(0, 15)) curve(dQXGP(x, mu=0.5, sigma=1, nu=1), from=0.001, to=500, add=TRUE, col="red") ## The Hazard function curve(hQXGP(x, mu=0.5, sigma=1, nu=1), from=0.01, to=3, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the reduced new modified Weibull
distribution with parameters mu, sigma and nu.
dRNMW(x, mu, sigma, nu, log = FALSE) pRNMW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qRNMW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rRNMW(n, mu, sigma, nu) hRNMW(x, mu, sigma, nu)dRNMW(x, mu, sigma, nu, log = FALSE) pRNMW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qRNMW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rRNMW(n, mu, sigma, nu) hRNMW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter one. |
sigma |
parameter two. |
nu |
parameter three. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[T <= t], otherwise, P[T > t]. |
p |
vector of probabilities. |
n |
number of observations. |
The reduced new modified Weibull with parameters mu, sigma
and nu has density given by
for , , and .
dRNMW gives the density, pRNMW gives the distribution
function, qRNMW gives the quantile function, rRNMW
generates random deviates and hRNMW gives the hazard function.
Jaime Mosquera, [email protected]
Almalki, S. J. (2018). A reduced new modified Weibull distribution. Communications in Statistics-Theory and Methods, 47(10), 2297-2313.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve( dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, to = 5, col = "red", las = 1, ylab = "f(x)" ) ## The cualphalative distribution and the Reliability function par(mfrow = c(1, 2)) curve( pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)" ) curve( pRNMW( x, mu = 0.05, sigma = 0.00025, nu = 2.2, lower.tail = FALSE ), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)" ) ## The quantile function p <- seq(from = 0, to = 0.999, length.out = 100) plot( x = qRNMW(p, mu = 0.05, sigma = 0.00025, nu = 2.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability" ) curve( pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, add = TRUE, col = "red" ) ## The random function hist( rRNMW(n = 10000, mu = 0.05, sigma = 0.00025, nu = 2.2), freq = FALSE, xlab = "x", las = 1, main = "", ylim = c(0,0.8) ) curve(dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, add = TRUE, col = "red" ) ## The Hazard function par(mfrow = c(1, 1)) curve( hRNMW(x, mu = 0.003, sigma = 5e-6, nu = 0.025), from = 0, to = 250, col = "red", ylab = "Hazard function", las = 1 ) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve( dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, to = 5, col = "red", las = 1, ylab = "f(x)" ) ## The cualphalative distribution and the Reliability function par(mfrow = c(1, 2)) curve( pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)" ) curve( pRNMW( x, mu = 0.05, sigma = 0.00025, nu = 2.2, lower.tail = FALSE ), from = 0, to = 5, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)" ) ## The quantile function p <- seq(from = 0, to = 0.999, length.out = 100) plot( x = qRNMW(p, mu = 0.05, sigma = 0.00025, nu = 2.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability" ) curve( pRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, add = TRUE, col = "red" ) ## The random function hist( rRNMW(n = 10000, mu = 0.05, sigma = 0.00025, nu = 2.2), freq = FALSE, xlab = "x", las = 1, main = "", ylim = c(0,0.8) ) curve(dRNMW(x, mu = 0.05, sigma = 0.00025, nu = 2.2), from = 0, add = TRUE, col = "red" ) ## The Hazard function par(mfrow = c(1, 1)) curve( hRNMW(x, mu = 0.003, sigma = 5e-6, nu = 0.025), from = 0, to = 250, col = "red", ylab = "Hazard function", las = 1 ) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Reflected Weibull Distribution
with parameters mu and sigma.
dRW(x, mu, sigma, log = FALSE) pRW(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qRW(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rRW(n, mu, sigma) hRW(x, mu, sigma)dRW(x, mu, sigma, log = FALSE) pRW(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qRW(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rRW(n, mu, sigma) hRW(x, mu, sigma)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Reflected Weibull Distribution with parameters mu
and sigma has density given by
for .
dRW gives the density, pRW gives the distribution
function, qRW gives the quantile function, rRW
generates random deviates and hRW gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Cohen, A. C. (1973). The reflected Weibull distribution. Technometrics, 15(4), 867-873.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dRW(x, mu=1, sigma=1), from=-5, to=-0.01, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pRW(x, mu=1, sigma=1), from=-5, to=-0.01, col="red", las=1, ylab="F(x)") curve(pRW(x, mu=1, sigma=1, lower.tail=FALSE), from=-5, to=-0.01, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qRW(p, mu=1, sigma=1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pRW(x, mu=1, sigma=1), from=-5, add=TRUE, col="red") ## The random function hist(rRW(n=10000, mu=1, sigma=1), freq=FALSE, xlab="x", las=1, main="") curve(dRW(x, mu=1, sigma=1), from=-5, to=-0.01, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hRW(x, mu=1, sigma=1), from=-0.3, to=-0.01, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dRW(x, mu=1, sigma=1), from=-5, to=-0.01, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pRW(x, mu=1, sigma=1), from=-5, to=-0.01, col="red", las=1, ylab="F(x)") curve(pRW(x, mu=1, sigma=1, lower.tail=FALSE), from=-5, to=-0.01, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qRW(p, mu=1, sigma=1), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pRW(x, mu=1, sigma=1), from=-5, add=TRUE, col="red") ## The random function hist(rRW(n=10000, mu=1, sigma=1), freq=FALSE, xlab="x", las=1, main="") curve(dRW(x, mu=1, sigma=1), from=-5, to=-0.01, add=TRUE, col="red") ## The Hazard function par(mfrow=c(1,1)) curve(hRW(x, mu=1, sigma=1), from=-0.3, to=-0.01, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for Sarhan and Zaindins modified weibull distribution
with parameters mu, sigma and nu.
dSZMW(x, mu, sigma, nu, log = FALSE) pSZMW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qSZMW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rSZMW(n, mu, sigma, nu) hSZMW(x, mu, sigma, nu)dSZMW(x, mu, sigma, nu, log = FALSE) pSZMW(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qSZMW(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rSZMW(n, mu, sigma, nu) hSZMW(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
scale parameter. |
sigma |
shape parameter. |
nu |
shape parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Sarhan and Zaindins modified weibull with parameters mu,
sigma and nu has density given by
for , , and .
dSZMW gives the density, pSZMW gives the distribution
function, qSZMW gives the quantile function, rSZMW
generates random deviates and hSZMW gives the hazard function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Sarhan, A. M., & Zaindin, M. (2009). Modified Weibull distribution. APPS. Applied Sciences, 11, 123-136.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, to = 2, ylim = c(0, 1.7), col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, to = 2, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pSZMW(x, mu = 2, sigma = 1.5, nu = 0.2, lower.tail = FALSE), from = 0, to = 2, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qSZMW(p = p, mu = 2, sigma = 1.5, nu = 0.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, add = TRUE, col = "red") ## The random function hist(rSZMW(n = 1000, mu = 2, sigma = 1.5, nu = 0.2), freq = FALSE, xlab = "x", las = 1, main = "") curve(dSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, add = TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, to = 3, ylim = c(0, 8), col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, to = 2, ylim = c(0, 1.7), col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, to = 2, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pSZMW(x, mu = 2, sigma = 1.5, nu = 0.2, lower.tail = FALSE), from = 0, to = 2, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qSZMW(p = p, mu = 2, sigma = 1.5, nu = 0.2), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, add = TRUE, col = "red") ## The random function hist(rSZMW(n = 1000, mu = 2, sigma = 1.5, nu = 0.2), freq = FALSE, xlab = "x", las = 1, main = "") curve(dSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, add = TRUE, col = "red") ## The Hazard function par(mfrow=c(1,1)) curve(hSZMW(x, mu = 2, sigma = 1.5, nu = 0.2), from = 0, to = 3, ylim = c(0, 8), col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parameters
These functions define the density, distribution function, quantile
function and random generation for the Wald distribution
with parameter and .
dWALD(x, mu, sigma, log = FALSE) pWALD(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qWALD(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rWALD(n, mu, sigma)dWALD(x, mu, sigma, log = FALSE) pWALD(q, mu, sigma, lower.tail = TRUE, log.p = FALSE) qWALD(p, mu, sigma, lower.tail = TRUE, log.p = FALSE) rWALD(n, mu, sigma)
x, q
|
vector of (non-negative integer) quantiles. |
mu |
vector of the mu parameter. |
sigma |
vector of the sigma parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of random values to return. |
The Wald distribution with parameters and has density given by
for .
dWALD gives the density, pWALD gives the distribution
function, qWALD gives the quantile function, rWALD
generates random deviates.
Sofia Cuartas, [email protected]
Heathcote, A. (2004). Fitting Wald and ex-Wald distributions to response time data: An example using functions for the S-PLUS package. Behavior Research Methods, Instruments, & Computers, 36, 678-694.
WALD.
# Example 1 # Plotting the mass function for different parameter values curve(dWALD(x, mu=1, sigma=1), from=0, to=3, col="cadetblue3", las=1, ylab="f(x)") curve(dWALD(x, mu=1, sigma=2), add=TRUE, col= "purple") curve(dWALD(x, mu=2, sigma=4), add=TRUE, col="goldenrod") legend("topright", col=c("cadetblue3", "purple", "goldenrod"), lty=1, bty="n", legend=c("mu=1, sigma=1", "mu=1, sigma=2", "mu=2, sigma=4")) # Example 2 # Checking if the cumulative curves converge to 1 curve(pWALD(x, mu=1, sigma=1), ylim=c(0, 1), from=0, to=5, col="cadetblue3", las=1, ylab="F(x)") curve(pWALD(x, mu=1, sigma=2), add=TRUE, col= "purple") curve(pWALD(x, mu=2, sigma=4), add=TRUE, col="goldenrod") legend("bottomright", col=c("cadetblue3", "purple", "goldenrod"), lty=1, bty="n", legend=c("mu=1, sigma=1", "mu=1, sigma=2", "mu=2, sigma=4")) # Example 3 # Checking the quantile function mu <- 1 sigma <- 2 p <- seq(from=0, to=0.999, length.out=100) plot(x=qWALD(p, mu=mu, sigma=sigma), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pWALD(x, mu=mu, sigma=sigma), from=0, add=TRUE, col="red") # Example 4 # Comparing the random generator output with # the theoretical probabilities mu <- 1 sigma <- 20 x <- rWALD(n=10000, mu=mu, sigma=sigma) hist(x, freq=FALSE) curve(dWALD(x, mu=mu, sigma=sigma), col="tomato", add=TRUE)# Example 1 # Plotting the mass function for different parameter values curve(dWALD(x, mu=1, sigma=1), from=0, to=3, col="cadetblue3", las=1, ylab="f(x)") curve(dWALD(x, mu=1, sigma=2), add=TRUE, col= "purple") curve(dWALD(x, mu=2, sigma=4), add=TRUE, col="goldenrod") legend("topright", col=c("cadetblue3", "purple", "goldenrod"), lty=1, bty="n", legend=c("mu=1, sigma=1", "mu=1, sigma=2", "mu=2, sigma=4")) # Example 2 # Checking if the cumulative curves converge to 1 curve(pWALD(x, mu=1, sigma=1), ylim=c(0, 1), from=0, to=5, col="cadetblue3", las=1, ylab="F(x)") curve(pWALD(x, mu=1, sigma=2), add=TRUE, col= "purple") curve(pWALD(x, mu=2, sigma=4), add=TRUE, col="goldenrod") legend("bottomright", col=c("cadetblue3", "purple", "goldenrod"), lty=1, bty="n", legend=c("mu=1, sigma=1", "mu=1, sigma=2", "mu=2, sigma=4")) # Example 3 # Checking the quantile function mu <- 1 sigma <- 2 p <- seq(from=0, to=0.999, length.out=100) plot(x=qWALD(p, mu=mu, sigma=sigma), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pWALD(x, mu=mu, sigma=sigma), from=0, add=TRUE, col="red") # Example 4 # Comparing the random generator output with # the theoretical probabilities mu <- 1 sigma <- 20 x <- rWALD(n=10000, mu=mu, sigma=sigma) hist(x, freq=FALSE) curve(dWALD(x, mu=mu, sigma=sigma), col="tomato", add=TRUE)
Density, distribution function, quantile function,
random generation and hazard function for the weibull geometric distribution with
parameters mu, sigma and nu.
dWG(x, mu, sigma, nu, log = FALSE) pWG(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qWG(p, sigma, mu, nu, lower.tail = TRUE, log.p = FALSE) rWG(n, mu, sigma, nu) hWG(x, mu, sigma, nu)dWG(x, mu, sigma, nu, log = FALSE) pWG(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qWG(p, sigma, mu, nu, lower.tail = TRUE, log.p = FALSE) rWG(n, mu, sigma, nu) hWG(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
scale parameter. |
sigma |
shape parameter. |
nu |
parameter of geometric random variable. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Weibull geometric distribution with parameters mu,
sigma and nu has density given by
for , , and .
dWG gives the density, pWG gives the distribution
function, qWG gives the quantile function, rWG
generates random deviates and hWG gives the hazard function.
Johan David Marin Benjumea, [email protected]
Barreto-Souza, W., de Morais, A. L., & Cordeiro, G. M. (2011). The Weibull-geometric distribution. Journal of Statistical Computation and Simulation, 81(5), 645-657.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, to = 3, ylim = c(0, 1.1), col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, to = 3, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pWG(x, mu = 0.9, sigma = 2, nu = 0.5, lower.tail = FALSE), from = 0, to = 3, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qWG(p = p, mu = 0.9, sigma = 2, nu = 0.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pWG(x,mu = 0.9, sigma = 2, nu = 0.5), from = 0, add = TRUE, col = "red") ## The random function hist(rWG(1000, mu = 0.9, sigma = 2, nu = 0.5), freq = FALSE, xlab = "x", ylim = c(0, 1.8), las = 1, main = "") curve(dWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, add = TRUE, col = "red", ylim = c(0, 1.8)) ## The Hazard function( par(mfrow=c(1,1)) curve(hWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, to = 8, ylim = c(0, 12), col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, to = 3, ylim = c(0, 1.1), col = "red", las = 1, ylab = "f(x)") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, to = 3, ylim = c(0, 1), col = "red", las = 1, ylab = "F(x)") curve(pWG(x, mu = 0.9, sigma = 2, nu = 0.5, lower.tail = FALSE), from = 0, to = 3, ylim = c(0, 1), col = "red", las = 1, ylab = "R(x)") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qWG(p = p, mu = 0.9, sigma = 2, nu = 0.5), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pWG(x,mu = 0.9, sigma = 2, nu = 0.5), from = 0, add = TRUE, col = "red") ## The random function hist(rWG(1000, mu = 0.9, sigma = 2, nu = 0.5), freq = FALSE, xlab = "x", ylim = c(0, 1.8), las = 1, main = "") curve(dWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, add = TRUE, col = "red", ylim = c(0, 1.8)) ## The Hazard function( par(mfrow=c(1,1)) curve(hWG(x, mu = 0.9, sigma = 2, nu = 0.5), from = 0, to = 8, ylim = c(0, 12), col = "red", ylab = "Hazard function", las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Weighted Generalized Exponential-Exponential distribution
with parameters mu, sigma and nu.
dWGEE(x, mu, sigma, nu, log = FALSE) pWGEE(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qWGEE(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rWGEE(n, mu, sigma, nu) hWGEE(x, mu, sigma, nu)dWGEE(x, mu, sigma, nu, log = FALSE) pWGEE(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qWGEE(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rWGEE(n, mu, sigma, nu) hWGEE(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Weighted Generalized Exponential-Exponential Distribution with parameters mu,
sigma and nu has density given by
for , , and .
dWGEE gives the density, pWGEE gives the distribution
function, qWGEE gives the quantile function, rWGEE
generates random deviates and hWGEE gives the hazard function.
Johan David Marin Benjumea, [email protected]
Mahdavi, A. (2015). Two weighted distributions generated by exponential distribution. Journal of Mathematical Extension, 9, 1-12.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "The probability density function") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "The cumulative distribution function") curve(pWGEE(x, mu = 5, sigma = 0.5, nu = 1, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "The Reliability function") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qWGEE(p = p, mu = 5, sigma = 0.5, nu = 1), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, add = TRUE, col = "red") ## The random function hist(rWGEE(1000, mu = 5, sigma = 0.5, nu = 1), freq = FALSE, xlab = "x", ylim = c(0, 1), las = 1, main = "") curve(dWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, add = TRUE, col = "red", ylim = c(0, 1)) ## The Hazard function( par(mfrow=c(1,1)) curve(hWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, to = 6, ylim = c(0, 1.4), col = "red", ylab = "The hazard function", las = 1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "The probability density function") ## The cumulative distribution and the Reliability function par(mfrow = c(1, 2)) curve(pWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "The cumulative distribution function") curve(pWGEE(x, mu = 5, sigma = 0.5, nu = 1, lower.tail = FALSE), from = 0, to = 6, ylim = c(0, 1), col = "red", las = 1, ylab = "The Reliability function") ## The quantile function p <- seq(from = 0, to = 0.99999, length.out = 100) plot(x = qWGEE(p = p, mu = 5, sigma = 0.5, nu = 1), y = p, xlab = "Quantile", las = 1, ylab = "Probability") curve(pWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, add = TRUE, col = "red") ## The random function hist(rWGEE(1000, mu = 5, sigma = 0.5, nu = 1), freq = FALSE, xlab = "x", ylim = c(0, 1), las = 1, main = "") curve(dWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, add = TRUE, col = "red", ylim = c(0, 1)) ## The Hazard function( par(mfrow=c(1,1)) curve(hWGEE(x, mu = 5, sigma = 0.5, nu = 1), from = 0, to = 6, ylim = c(0, 1.4), col = "red", ylab = "The hazard function", las = 1) par(old_par) # restore previous graphical parameters
Density, distribution function, quantile function,
random generation and hazard function for the Weibull Poisson distribution
with parameters mu, sigma and nu.
dWP(x, mu, sigma, nu, log = FALSE) pWP(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qWP(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rWP(n, mu, sigma, nu) hWP(x, mu, sigma, nu)dWP(x, mu, sigma, nu, log = FALSE) pWP(q, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) qWP(p, mu, sigma, nu, lower.tail = TRUE, log.p = FALSE) rWP(n, mu, sigma, nu) hWP(x, mu, sigma, nu)
x, q
|
vector of quantiles. |
mu |
parameter. |
sigma |
parameter. |
nu |
parameter. |
log, log.p
|
logical; if TRUE, probabilities p are given as log(p). |
lower.tail |
logical; if TRUE (default), probabilities are P[X <= x], otherwise, P[X > x]. |
p |
vector of probabilities. |
n |
number of observations. |
The Weibull Poisson distribution with parameters mu,
sigma and nu has density given by
for .
dWP gives the density, pWP gives the distribution
function, qWP gives the quantile function, rWP
generates random deviates and hWP gives the hazard function.
Amylkar Urrea Montoya, [email protected]
Lu, Wanbo, and Daimin Shi. "A new compounding life distribution: the Weibull–Poisson distribution." Journal of applied statistics 39.1 (2012): 21-38.
old_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dWP(x, mu=1.5, sigma=0.5, nu=10), from=0.0001, to=2, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pWP(x, mu=1.5, sigma=0.5, nu=10), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pWP(x, mu=1.5, sigma=0.5, nu=10, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qWP(p, mu=1.5, sigma=0.5, nu=10), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pWP(x, mu=1.5, sigma=0.5, nu=10), from=0, add=TRUE, col="red") ## The random function hist(rWP(n=10000, mu=1.5, sigma=0.5, nu=10), freq=FALSE, xlab="x", ylim=c(0, 2.2), las=1, main="") curve(dWP(x, mu=1.5, sigma=0.5, nu=10), from=0.001, to=4, add=TRUE, col="red") ## The Hazard function curve(hWP(x, mu=1.5, sigma=0.5, nu=10), from=0.001, to=5, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parametersold_par <- par(mfrow = c(1, 1)) # save previous graphical parameters ## The probability density function curve(dWP(x, mu=1.5, sigma=0.5, nu=10), from=0.0001, to=2, col="red", las=1, ylab="f(x)") ## The cumulative distribution and the Reliability function par(mfrow=c(1, 2)) curve(pWP(x, mu=1.5, sigma=0.5, nu=10), from=0.0001, to=2, col="red", las=1, ylab="F(x)") curve(pWP(x, mu=1.5, sigma=0.5, nu=10, lower.tail=FALSE), from=0.0001, to=2, col="red", las=1, ylab="R(x)") ## The quantile function p <- seq(from=0, to=0.99999, length.out=100) plot(x=qWP(p, mu=1.5, sigma=0.5, nu=10), y=p, xlab="Quantile", las=1, ylab="Probability") curve(pWP(x, mu=1.5, sigma=0.5, nu=10), from=0, add=TRUE, col="red") ## The random function hist(rWP(n=10000, mu=1.5, sigma=0.5, nu=10), freq=FALSE, xlab="x", ylim=c(0, 2.2), las=1, main="") curve(dWP(x, mu=1.5, sigma=0.5, nu=10), from=0.001, to=4, add=TRUE, col="red") ## The Hazard function curve(hWP(x, mu=1.5, sigma=0.5, nu=10), from=0.001, to=5, col="red", ylab="Hazard function", las=1) par(old_par) # restore previous graphical parameters
The Extended Exponential Geometric family
EEG(mu.link = "log", sigma.link = "log")EEG(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Extended Exponential Geometric distribution with parameters mu
and sigma has density given by
for , and .
Returns a gamlss.family object which can be used to fit a EEG distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Adamidis, K., Dimitrakopoulou, T., & Loukas, S. (2005). On an extension of the exponential-geometric distribution. Statistics & probability letters, 73(3), 259-269.
# Generating some random values with # known mu, sigma, nu and tau y <- rEEG(n=100, mu = 1, sigma =1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family=EEG, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.1, max=0.2) x2 <- runif(n, min=0.1, max=0.15) mu <- exp(0.75 - x1) sigma <- exp(0.5 - x2) x <- rEEG(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=EEG, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")# Generating some random values with # known mu, sigma, nu and tau y <- rEEG(n=100, mu = 1, sigma =1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family=EEG, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.1, max=0.2) x2 <- runif(n, min=0.1, max=0.15) mu <- exp(0.75 - x1) sigma <- exp(0.5 - x2) x <- rEEG(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=EEG, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")
The four parameter Exponentiated Generalized Gamma distribution
EGG(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")EGG(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
tau.link |
defines the tau.link, with "log" link as the default for the tau parameter. |
Four parameter Exponentiated Generalized Gamma distribution with parameters mu,
sigma, nu and tau has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a EGG distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Cordeiro, G. M., Ortega, E. M., & Silva, G. O. (2011). The exponentiated generalized gamma distribution with application to lifetime data. Journal of statistical computation and simulation, 81(7), 827-842.
# Example 1 # Generating some random values with # known mu, sigma, nu and tau set.seed(123456) y <- rEGG(n=100, mu=0.1, sigma=0.8, nu=10, tau=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EGG, control=gamlss.control(n.cyc=500, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) exp(coef(mod, what="tau")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ EGG gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-0.8 + -3 * x1) sigma <- exp(0.77 - 2 * x2) nu <- 10 tau <- 1.5 y <- rEGG(n=n, mu=mu, sigma=sigma, nu=nu, tau) data.frame(y=y, x1=x1, x2=x2) } set.seed(12345) dat <- gendat(n=200) mod <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=EGG, data=dat, control=gamlss.control(n.cyc=500, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))# Example 1 # Generating some random values with # known mu, sigma, nu and tau set.seed(123456) y <- rEGG(n=100, mu=0.1, sigma=0.8, nu=10, tau=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EGG, control=gamlss.control(n.cyc=500, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) exp(coef(mod, what="tau")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ EGG gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-0.8 + -3 * x1) sigma <- exp(0.77 - 2 * x2) nu <- 10 tau <- 1.5 y <- rEGG(n=n, mu=mu, sigma=sigma, nu=nu, tau) data.frame(y=y, x1=x1, x2=x2) } set.seed(12345) dat <- gendat(n=200) mod <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=EGG, data=dat, control=gamlss.control(n.cyc=500, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))
The Exponentiated Modifien Weibull Extension family
EMWEx(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")EMWEx(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
tau.link |
defines the tau.link, with "log" link as the default for the tau parameter. |
The Beta-Weibull distribution with parameters mu,
sigma, nu and tau has density given by
for , , , and .
Returns a gamlss.family object which can be used to fit a EMWEx distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Sarhan, A. M., & Apaloo, J. (2013). Exponentiated modified Weibull extension distribution. Reliability Engineering & System Safety, 112, 137-144.
# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rEMWEx(n=100, mu = 1, sigma =1.21, nu=1, tau=2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EMWEx, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.75 - x1) sigma <- exp(0.5 - x2) nu <- 1 tau <- 2 x <- rEMWEx(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=EMWEx, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rEMWEx(n=100, mu = 1, sigma =1.21, nu=1, tau=2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EMWEx, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.75 - x1) sigma <- exp(0.5 - x2) nu <- 1 tau <- 2 x <- rEMWEx(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=EMWEx, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))
The Extended Odd Frechet-Nadarjad-Hanhighi family
EOFNH(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")EOFNH(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
tau.link |
defines the tau.link, with "log" link as the default for the tau parameter. |
The Extended Odd Frechet-Nadarajah-Haghighi distribution with parameters mu,
sigma, nu and tau has density given by
for , , , and .
Returns a gamlss.family object which can be used to fit a EOFNH distribution in the gamlss() function.
Helber Santiago Padilla, [email protected]
Nasiru, S. (2018). Extended Odd Fréchet‐G Family of Distributions Journal of Probability and Statistics, 2018(1), 2931326.
# Example 1 # Generating some random values with # known mu, sigma, nu and tau set.seed(123) y <- rEOFNH(n=100, mu=1, sigma=2.1, nu=0.8, tau=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EOFNH, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) exp(coef(mod, what="tau")) # Example 2 # Generating random values under the model n <- 100 x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1.2 * x1) sigma <- 2.1 nu <- 0.8 tau <- 1 y <- rEOFNH(n=n, mu, sigma, nu, tau) mod <- gamlss(y~x1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EOFNH, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))# Example 1 # Generating some random values with # known mu, sigma, nu and tau set.seed(123) y <- rEOFNH(n=100, mu=1, sigma=2.1, nu=0.8, tau=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EOFNH, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) exp(coef(mod, what="tau")) # Example 2 # Generating random values under the model n <- 100 x1 <- runif(n) x2 <- runif(n) mu <- exp(0.5 - 1.2 * x1) sigma <- 2.1 nu <- 0.8 tau <- 1 y <- rEOFNH(n=n, mu, sigma, nu, tau) mod <- gamlss(y~x1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=EOFNH, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))
Time to failure in hours of 18 units of the same electronic device.
data(equipment)data(equipment)
A vector with 18 observations.
data(equipment) hist(equipment, main="", xlab="Time (h)")data(equipment) hist(equipment, main="", xlab="Time (h)")
This function generates initial values for the GL2 distribution
estim_mu_sigma_GL2(y)estim_mu_sigma_GL2(y)
y |
vector with the random sample |
y <- rGL2(n = 100, mu = 3, sigma = 1.2) estim_mu_sigma_GL2(y = y)y <- rGL2(n = 100, mu = 3, sigma = 1.2) estim_mu_sigma_GL2(y = y)
The Exponentiated Weibull distribution
EW(mu.link = "log", sigma.link = "log", nu.link = "log")EW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Exponentiated Weibull Distribution with parameters mu,
sigma and nu has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a EW distribution in the gamlss() function.
# Example 1 # Generating some random values with # known mu, sigma and nu # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: y <- rEW(n=100, mu=2, sigma=1.5, nu=0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='EW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) ## End(Not run) # Example 2 # Generating random values under some model # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: n <- 200 x1 <- rpois(n, lambda=2) x2 <- runif(n) mu <- exp(2 + -3 * x1) sigma <- exp(3 - 2 * x2) nu <- 2 x <- rEW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=EW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) ## End(Not run)# Example 1 # Generating some random values with # known mu, sigma and nu # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: y <- rEW(n=100, mu=2, sigma=1.5, nu=0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='EW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) ## End(Not run) # Example 2 # Generating random values under some model # Will not be run this example because high number is cycles # is needed in order to get good estimates ## Not run: n <- 200 x1 <- rpois(n, lambda=2) x2 <- runif(n) mu <- exp(2 + -3 * x1) sigma <- exp(3 - 2 * x2) nu <- 2 x <- rEW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=EW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) ## End(Not run)
The function EXL() defines The exponentiated XLindley,
a two parameter distribution, for a gamlss.family object
to be used in GAMLSS fitting
using the function gamlss().
EXL(mu.link = "log", sigma.link = "log")EXL(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The exponentiated XLindley with parameters mu and sigma
has density given by
for , and .
Note: In this implementation we changed the original parameters
for and for we
did it to implement this distribution within gamlss framework.
Returns a gamlss.family object which can be used to fit a
EXL distribution in the gamlss() function.
Manuel Gutierrez Tangarife, [email protected]
Alomair, A. M., Ahmed, M., Tariq, S., Ahsan-ul-Haq, M., & Talib, J. (2024). An exponentiated XLindley distribution with properties, inference and applications. Heliyon, 10(3).
EXL.
# Example 1 # Generating some random values with # known mu and sigma y <- rEXL(n=300, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=EXL, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ EXL gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rEXL(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=EXL, data=dat, control=gamlss.control(n.cyc=5000, trace=FALSE)) summary(mod2) # Example 3 # Mortality rate due to COVID-19 for 30 days (31st March to April 30, 2020) # recorded for the Netherlands. # Taken from Alomair et al. (2024) page 12. x <- c(14.918, 10.656, 12.274, 10.289, 10.832, 7.099, 5.928, 13.211, 7.968, 7.584, 5.555, 6.027, 4.097, 3.611, 4.960, 7.498, 6.940, 5.307, 5.048, 2.857, 2.254, 5.431, 4.462, 3.883, 3.461, 3.647, 1.974, 1.273, 1.416, 4.235) mod3 <- gamlss(x~1, sigma.fo=~1, family=EXL, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Replicating figure 4 from Alomair et al. (2024) # Hist and estimated pdf hist(x, freq=FALSE) curve(dEXL(x, mu=0.4089915, sigma=2.710467), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(x)) curve(pEXL(x, mu=0.4089915, sigma=2.710467), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(x, rEXL(n=30, mu=0.4089915, sigma=2.710467), col="tomato") qqline(x, distribution=function(p) qEXL(p, mu=0.4089915, sigma=2.710467)) # Example 4 # Precipitation in inches # Taken from Alomair et al. (2024) page 13. # Manuel# Example 1 # Generating some random values with # known mu and sigma y <- rEXL(n=300, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=EXL, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ EXL gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) sigma <- exp(2 - 1.5 * x2) y <- rEXL(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=100) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=EXL, data=dat, control=gamlss.control(n.cyc=5000, trace=FALSE)) summary(mod2) # Example 3 # Mortality rate due to COVID-19 for 30 days (31st March to April 30, 2020) # recorded for the Netherlands. # Taken from Alomair et al. (2024) page 12. x <- c(14.918, 10.656, 12.274, 10.289, 10.832, 7.099, 5.928, 13.211, 7.968, 7.584, 5.555, 6.027, 4.097, 3.611, 4.960, 7.498, 6.940, 5.307, 5.048, 2.857, 2.254, 5.431, 4.462, 3.883, 3.461, 3.647, 1.974, 1.273, 1.416, 4.235) mod3 <- gamlss(x~1, sigma.fo=~1, family=EXL, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Replicating figure 4 from Alomair et al. (2024) # Hist and estimated pdf hist(x, freq=FALSE) curve(dEXL(x, mu=0.4089915, sigma=2.710467), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(x)) curve(pEXL(x, mu=0.4089915, sigma=2.710467), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(x, rEXL(n=30, mu=0.4089915, sigma=2.710467), col="tomato") qqline(x, distribution=function(p) qEXL(p, mu=0.4089915, sigma=2.710467)) # Example 4 # Precipitation in inches # Taken from Alomair et al. (2024) page 13. # Manuel
The Extended Weibull family
ExW(mu.link = "log", sigma.link = "log", nu.link = "log")ExW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Extended Weibull distribution with parameters mu,
sigma and nu has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a ExW distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Zhang, T., & Xie, M. (2007). Failure data analysis with extended Weibull distribution. Communications in Statistics—Simulation and Computation, 36(3), 579-592.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rExW(n=200, mu=0.3, sigma=2, nu=0.05) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='ExW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-2 + 3 * x1) sigma <- exp(1.3 - 2 * x2) nu <- 0.05 x <- rExW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=ExW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rExW(n=200, mu=0.3, sigma=2, nu=0.05) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='ExW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-2 + 3 * x1) sigma <- exp(1.3 - 2 * x2) nu <- 0.05 x <- rExW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=ExW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The function ExWALD() defines the Ex-wALD distribution, three-parameter
continuous distribution for a gamlss.family object to be used in
GAMLSS fitting using the function gamlss().
ExWALD(mu.link = "log", sigma.link = "log", nu.link = "log")ExWALD(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma parameter. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Ex-Wald distribution with parameters ,
and has density given by
where ,
and
corresponds to the cumulative function of
the Wald distribution.
More details about those expressions can be found on page 680 from Heathcote (2004).
Returns a gamlss.family object which can be used to fit a
Ex-WALD distribution in the gamlss() function.
Freddy Hernandez, [email protected]
Schwarz, W. (2001). The ex-Wald distribution as a descriptive model of response times. Behavior Research Methods, Instruments, & Computers, 33, 457-469.
Heathcote, A. (2004). Fitting Wald and ex-Wald distributions to response time data: An example using functions for the S-PLUS package. Behavior Research Methods, Instruments, & Computers, 36, 678-694.
# Example 1 # Generating random values with # known mu, sigma and nu mu <- 0.20 sigma <- 70 nu <- 115 set.seed(123) y <- rExWALD(n=100, mu, sigma, nu) library(gamlss) mod1 <- gamlss(y~1, family=ExWALD, control=gamlss.control(n.cyc=1000, trace=TRUE)) exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) exp(coef(mod1, what="nu")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ ExWALD gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-1 + 2.8 * x1) # 1.5 approximately sigma <- exp( 1 - 1.2 * x2) # 1.5 approximately nu <- 2 y <- rExWALD(n=n, mu=mu, sigma=sigma, nu=nu) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=200) # Fitting the model mod2 <- gamlss(y ~ x1, sigma.fo = ~ x2, nu.fo = ~ 1, family = ExWALD, data = dat, control = gamlss.control(n.cyc=1000, trace=TRUE)) summary(mod2)# Example 1 # Generating random values with # known mu, sigma and nu mu <- 0.20 sigma <- 70 nu <- 115 set.seed(123) y <- rExWALD(n=100, mu, sigma, nu) library(gamlss) mod1 <- gamlss(y~1, family=ExWALD, control=gamlss.control(n.cyc=1000, trace=TRUE)) exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) exp(coef(mod1, what="nu")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ ExWALD gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-1 + 2.8 * x1) # 1.5 approximately sigma <- exp( 1 - 1.2 * x2) # 1.5 approximately nu <- 2 y <- rExWALD(n=n, mu=mu, sigma=sigma, nu=nu) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=200) # Fitting the model mod2 <- gamlss(y ~ x1, sigma.fo = ~ x2, nu.fo = ~ 1, family = ExWALD, data = dat, control = gamlss.control(n.cyc=1000, trace=TRUE)) summary(mod2)
The function FWE() defines the Flexible Weibull distribution, a two parameter
distribution, for a gamlss.family object to be used in GAMLSS fitting
using the function gamlss().
FWE(mu.link = "log", sigma.link = "log")FWE(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Flexible Weibull extension with parameters mu and sigma
has density given by
for .
Returns a gamlss.family object which can be used to fit a FWE distribution in the gamlss() function.
# Example 1 # Generating some random values with # known mu and sigma y <- rFWE(n=100, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family='FWE', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(1.21 - 3 * x1) sigma <- exp(1.26 - 2 * x2) x <- rFWE(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=FWE, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")# Example 1 # Generating some random values with # known mu and sigma y <- rFWE(n=100, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family='FWE', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(1.21 - 3 * x1) sigma <- exp(1.26 - 2 * x2) x <- rFWE(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=FWE, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")
The Gamma Weibull family
GammaW(mu.link = "log", sigma.link = "log", nu.link = "log")GammaW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Gamma Weibull distribution with parameters mu,
sigma and nu has density given by
for , , and .
Returns a gamlss.family object which can be used to fit a GammaW distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Stacy, E. W. (1962). A generalization of the gamma distribution. The Annals of mathematical statistics, 1187-1192.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rGammaW(n=100, mu = 0.5, sigma = 2, nu=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='GammaW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(1.2 -1.6 * x1) sigma <- exp(1.1 - 1 * x2) nu <- 1 y <- rGammaW(n=n, mu, sigma, nu) mod <- gamlss(y~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=GammaW, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rGammaW(n=100, mu = 0.5, sigma = 2, nu=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='GammaW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(1.2 -1.6 * x1) sigma <- exp(1.1 - 1 * x2) nu <- 1 y <- rGammaW(n=n, mu, sigma, nu) mod <- gamlss(y~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=GammaW, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The Generalized Gompertz family
GGD(mu.link = "log", sigma.link = "log", nu.link = "log")GGD(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Generalized Gompertz Distribution with parameters mu,
sigma and nu has density given by
for , , and
Returns a gamlss.family object which can be used to fit a GGD distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
#' El-Gohary, A., Alshamrani, A., & Al-Otaibi, A. N. (2013). The generalized Gompertz distribution. Applied mathematical modelling, 37(1-2), 13-24.
#Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rGGD(n=1000, mu=1, sigma=0.3, nu=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='GGD', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.5 - x1) sigma <- exp(-1 - x2) nu <- 1.5 x <- rGGD(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=GGD, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))#Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rGGD(n=1000, mu=1, sigma=0.3, nu=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='GGD', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.5 - x1) sigma <- exp(-1 - x2) nu <- 1.5 x <- rGGD(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=GGD, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The Generalized Inverse Weibull family
GIW(mu.link = "log", sigma.link = "log", nu.link = "log")GIW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Generalized Inverse Weibull distribution with parameters mu,
sigma and nu has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a GIW distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
De Gusmao, F. R., Ortega, E. M., & Cordeiro, G. M. (2011). The generalized inverse Weibull distribution. Statistical Papers, 52, 591-619.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rGIW(n=200, mu=3, sigma=5, nu=0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='GIW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-1.02 + 3 * x1) sigma <- exp(1.69 - 2 * x2) nu <- 0.5 x <- rGIW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=GIW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rGIW(n=200, mu=3, sigma=5, nu=0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='GIW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-1.02 + 3 * x1) sigma <- exp(1.69 - 2 * x2) nu <- 0.5 x <- rGIW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=GIW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The Generalized Lindley Type II (GL2) family for fitting positive continuous lifetime data within the GAMLSS framework.
GL2(mu.link = "log", sigma.link = "log")GL2(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter (mu > 0). |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma parameter (sigma > 0). |
The Generalized Lindley Type II distribution with parameters
mu and sigma has probability density function
for , and .
The distribution is a two-parameter extension of the classical Lindley distribution and belongs to the class of finite mixtures involving exponential and gamma components. It provides additional flexibility for modeling positively skewed lifetime data.
The original parameters of the distribution are denoted by
and . In the GAMLSS implementation,
they are re-parameterized as
and
.
The r-th raw moment is given by
In particular, the mean is
The GL2 distribution has been proposed for modeling lifetime and survival data and has shown greater flexibility than the classical Lindley and Exponential distributions in several applications.
Returns a gamlss.family object which can be used to fit a
GL2 distribution in the gamlss() function.
Sofia Cadavid Rueda, [email protected]
Ekhosuehi, N., Opone, F., & Odobaire, F. (2018). A New Generalized Two Parameter Lindley Distribution. Journal of the Nigerian Statistical Association, 30, 547-566.
# Example 1 # Generating some random values with # known mu and sigma set.seed(1234) y <- rGL2(n=500, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=GL2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y as GL2 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) # Approx 0.95 sigma <- exp(2 - 1.5 * x2) # Approx 3.50 y <- rGL2(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=1000) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=GL2, data=dat, control=gamlss.control(n.cyc=50, trace=FALSE)) summary(mod2) # Example 3 # Remission times (in months) of 128 bladder cancer patients # Taken from Lee and Wang (2003) # Ekhosuehi et al. (2018) Table 4 y <- c(0.08, 2.09, 3.48, 4.87, 6.94, 8.66, 13.11, 23.63, 0.20, 2.23, 3.52, 4.98, 6.97, 9.02, 13.29, 0.40, 2.26, 3.57, 5.06, 7.09, 9.22, 13.80, 25.74, 0.50, 2.46, 3.64, 5.09, 7.26, 9.47, 14.24, 25.82, 0.51, 2.54, 3.70, 5.17, 7.28, 9.74, 14.76, 26.31, 0.81, 2.62, 3.82, 5.32, 7.32, 10.06, 14.77, 32.15, 2.64, 3.88, 5.32, 7.39, 10.34, 14.83, 34.26, 0.90, 2.69, 4.18, 5.34, 7.59, 10.66, 15.96, 36.66, 1.05, 2.69, 4.23, 5.41, 7.62, 10.75, 16.62, 43.01, 1.19, 2.75, 4.26, 5.41, 7.63, 17.12, 46.12, 1.26, 2.83, 4.33, 5.49, 7.66, 11.25, 17.14, 79.05, 1.35, 2.87, 5.62, 7.87, 11.64, 17.36, 1.40, 3.02, 4.34, 5.71, 7.93, 11.79, 18.10, 1.46, 4.40, 5.85, 8.26, 11.98, 19.13, 1.76, 3.25, 4.50, 6.25, 8.37, 12.02, 2.02, 3.31, 4.51, 6.54, 8.53, 12.03, 20.28, 2.02, 3.36, 6.76, 12.07, 21.73, 2.07, 3.36, 6.93, 8.65, 12.63, 22.69) require(gamlss) mod3 <- gamlss(y ~ 1, sigma.fo = ~1, family = GL2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Comparing the empirical histogram with the estimated density hist(y, breaks=15, freq=FALSE, xlab="y", col="lightblue", border="white") curve(dGL2(x, mu=0.1247079, sigma=1.189219), add=TRUE, col="red", lwd=2)# Example 1 # Generating some random values with # known mu and sigma set.seed(1234) y <- rGL2(n=500, mu=0.75, sigma=1.3) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=GL2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y as GL2 gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(1.45 - 3 * x1) # Approx 0.95 sigma <- exp(2 - 1.5 * x2) # Approx 3.50 y <- rGL2(n=n, mu=mu, sigma=sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(1234) dat <- gendat(n=1000) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=GL2, data=dat, control=gamlss.control(n.cyc=50, trace=FALSE)) summary(mod2) # Example 3 # Remission times (in months) of 128 bladder cancer patients # Taken from Lee and Wang (2003) # Ekhosuehi et al. (2018) Table 4 y <- c(0.08, 2.09, 3.48, 4.87, 6.94, 8.66, 13.11, 23.63, 0.20, 2.23, 3.52, 4.98, 6.97, 9.02, 13.29, 0.40, 2.26, 3.57, 5.06, 7.09, 9.22, 13.80, 25.74, 0.50, 2.46, 3.64, 5.09, 7.26, 9.47, 14.24, 25.82, 0.51, 2.54, 3.70, 5.17, 7.28, 9.74, 14.76, 26.31, 0.81, 2.62, 3.82, 5.32, 7.32, 10.06, 14.77, 32.15, 2.64, 3.88, 5.32, 7.39, 10.34, 14.83, 34.26, 0.90, 2.69, 4.18, 5.34, 7.59, 10.66, 15.96, 36.66, 1.05, 2.69, 4.23, 5.41, 7.62, 10.75, 16.62, 43.01, 1.19, 2.75, 4.26, 5.41, 7.63, 17.12, 46.12, 1.26, 2.83, 4.33, 5.49, 7.66, 11.25, 17.14, 79.05, 1.35, 2.87, 5.62, 7.87, 11.64, 17.36, 1.40, 3.02, 4.34, 5.71, 7.93, 11.79, 18.10, 1.46, 4.40, 5.85, 8.26, 11.98, 19.13, 1.76, 3.25, 4.50, 6.25, 8.37, 12.02, 2.02, 3.31, 4.51, 6.54, 8.53, 12.03, 20.28, 2.02, 3.36, 6.76, 12.07, 21.73, 2.07, 3.36, 6.93, 8.65, 12.63, 22.69) require(gamlss) mod3 <- gamlss(y ~ 1, sigma.fo = ~1, family = GL2) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Comparing the empirical histogram with the estimated density hist(y, breaks=15, freq=FALSE, xlab="y", col="lightblue", border="white") curve(dGL2(x, mu=0.1247079, sigma=1.189219), add=TRUE, col="red", lwd=2)
The Generalized modified Weibull distribution
GMW(mu.link = "log", sigma.link = "log", nu.link = "sqrt", tau.link = "sqrt")GMW(mu.link = "log", sigma.link = "log", nu.link = "sqrt", tau.link = "sqrt")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "sqrt" link as the default for the nu parameter. |
tau.link |
defines the tau.link, with "sqrt" link as the default for the tau parameter. |
The Generalized modified Weibull distribution with parameters mu,
sigma, nu and tau has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a GMW distribution in the gamlss() function.
# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rGMW(n=100, mu=2, sigma=0.5, nu=2, tau=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~ 1, family='GMW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) (coef(mod, what='nu'))^2 (coef(mod, what='tau'))^2 # Example 2 # Generating random values under some model ## Not run: n <- 1000 x1 <- runif(n) x2 <- runif(n) mu <- exp(2 + -3 * x1) sigma <- exp(3 - 2 * x2) nu <- 2 tau <- 1.5 x <- rGMW(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~ 1, family="GMW", control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what="nu")^2 coef(mod, what="tau")^2 ## End(Not run)# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rGMW(n=100, mu=2, sigma=0.5, nu=2, tau=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~ 1, family='GMW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) (coef(mod, what='nu'))^2 (coef(mod, what='tau'))^2 # Example 2 # Generating random values under some model ## Not run: n <- 1000 x1 <- runif(n) x2 <- runif(n) mu <- exp(2 + -3 * x1) sigma <- exp(3 - 2 * x2) nu <- 2 tau <- 1.5 x <- rGMW(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~ 1, family="GMW", control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what="nu")^2 coef(mod, what="tau")^2 ## End(Not run)
This function can be used so as to get suggestions about initial values
and the search region for parameter estimation in OW distribution.
initValuesOW( formula, data = NULL, local_reg = loess.options(), interpolation = interp.options(), ... )initValuesOW( formula, data = NULL, local_reg = loess.options(), interpolation = interp.options(), ... )
formula |
an object of class |
data |
an optional data frame containing the response variables. If
data is not specified, the variables are taken from the
environment from which |
local_reg |
a list of control parameters for LOESS. See
|
interpolation |
a list of control parameters for interpolation function. See
|
... |
further arguments passed to
|
This function performs a non-parametric estimation of the empirical total time on test (TTT) plot. Then, this estimated curve can be used so as to get suggestions about initial values and the search region for parameters based on hazard shape associated to the shape of empirical TTT plot.
Returns an object of class c("initValOW", "HazardShape") containing:
sigma.start value for parameter of OW distribution.
nu.start value for parameter of OW distribution.
sigma.valid search region for parameter of OW distribution.
nu.valid search region for parameter of OW distribution.
TTTplot Total Time on Test transform computed from the data.
hazard_type shape of the hazard function determined from the TTT
plot.
Jaime Mosquera Gutiérrez [email protected]
# Example 1 # Bathtuh hazard and its corresponding TTT plot y1 <- rOW(n = 1000, mu = 0.1, sigma = 7, nu = 0.08) my_initial_guess1 <- initValuesOW(formula=y1~1) summary(my_initial_guess1) plot(my_initial_guess1, par_plot=list(mar=c(3.7,3.7,1,2.5), mgp=c(2.5,1,0))) curve(hOW(x, mu = 0.022, sigma = 8, nu = 0.01), from = 0, to = 80, ylim = c(0, 0.04), col = "red", ylab = "Hazard function", las = 1) # Example 2 # Bathtuh hazard and its corresponding TTT plot with right censored data y2 <- rOW(n = 1000, mu = 0.1, sigma = 7, nu = 0.08) status <- c(rep(1, 980), rep(0, 20)) my_initial_guess2 <- initValuesOW(formula=Surv(y2, status)~1) summary(my_initial_guess2) plot(my_initial_guess2, par_plot=list(mar=c(3.7,3.7,1,2.5), mgp=c(2.5,1,0))) curve(hOW(x, mu = 0.022, sigma = 8, nu = 0.01), from = 0, to = 80, ylim = c(0, 0.04), col = "red", ylab = "Hazard function", las = 1)# Example 1 # Bathtuh hazard and its corresponding TTT plot y1 <- rOW(n = 1000, mu = 0.1, sigma = 7, nu = 0.08) my_initial_guess1 <- initValuesOW(formula=y1~1) summary(my_initial_guess1) plot(my_initial_guess1, par_plot=list(mar=c(3.7,3.7,1,2.5), mgp=c(2.5,1,0))) curve(hOW(x, mu = 0.022, sigma = 8, nu = 0.01), from = 0, to = 80, ylim = c(0, 0.04), col = "red", ylab = "Hazard function", las = 1) # Example 2 # Bathtuh hazard and its corresponding TTT plot with right censored data y2 <- rOW(n = 1000, mu = 0.1, sigma = 7, nu = 0.08) status <- c(rep(1, 980), rep(0, 20)) my_initial_guess2 <- initValuesOW(formula=Surv(y2, status)~1) summary(my_initial_guess2) plot(my_initial_guess2, par_plot=list(mar=c(3.7,3.7,1,2.5), mgp=c(2.5,1,0))) curve(hOW(x, mu = 0.022, sigma = 8, nu = 0.01), from = 0, to = 80, ylim = c(0, 0.04), col = "red", ylab = "Hazard function", las = 1)
The Inverse Weibull distribution
IW(mu.link = "log", sigma.link = "log")IW(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Inverse Weibull distribution with parameters mu,
sigma has density given by
for , and
Returns a gamlss.family object which can be used to fit a IW distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Drapella, A. (1993). The complementary Weibull distribution: unknown or just forgotten?. Quality and reliability engineering international, 9(4), 383-385.
# Example 1 # Generating some random values with # known mu and sigma y <- rIW(n=100, mu=5, sigma=2.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, mu.fo=~1, sigma.fo=~1, family='IW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- rpois(n, lambda=2) x2 <- runif(n) mu <- exp(2 + -1 * x1) sigma <- exp(2 - 2 * x2) x <- rIW(n=n, mu, sigma) mod <- gamlss(x~x1, mu.fo=~1, sigma.fo=~x2, family=IW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")# Example 1 # Generating some random values with # known mu and sigma y <- rIW(n=100, mu=5, sigma=2.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, mu.fo=~1, sigma.fo=~1, family='IW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- rpois(n, lambda=2) x2 <- runif(n) mu <- exp(2 + -1 * x1) sigma <- exp(2 - 2 * x2) x <- rIW(n=n, mu, sigma) mod <- gamlss(x~x1, mu.fo=~1, sigma.fo=~x2, family=IW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")
The Kumaraswamy Inverse Weibull family
KumIW(mu.link = "log", sigma.link = "log", nu.link = "log")KumIW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Kumaraswamy Inverse Weibull Distribution with parameters mu,
sigma and nu has density given by
for , , and .
Returns a gamlss.family object which can be used to fit a KumIW distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Shahbaz, M. Q., Shahbaz, S., & Butt, N. S. (2012). The Kumaraswamy Inverse Weibull Distribution. Pakistan journal of statistics and operation research, 479-489.
# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rKumIW(n=100, mu = 1.5, sigma= 1.5, nu = 5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family="KumIW", control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1 - x1) sigma <- exp(1 - x2) nu <- 5 x <- rKumIW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=KumIW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rKumIW(n=100, mu = 1.5, sigma= 1.5, nu = 5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family="KumIW", control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1 - x1) sigma <- exp(1 - x2) nu <- 5 x <- rKumIW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=KumIW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The function LIN() defines the Lindley distribution with only one parameter
for a gamlss.family object to be used in GAMLSS fitting
using the function gamlss().
LIN(mu.link = "log")LIN(mu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
The Lindley with parameter mu has density given by
for x > 0 and .
Returns a gamlss.family object which can be used to fit a LIN distribution in the gamlss() function.
Freddy Hernandez [email protected]
Lindley, D. V. (1958). Fiducial distributions and Bayes' theorem. Journal of the Royal Statistical Society. Series B (Methodological), 102-107.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rLIN(n=200, mu=2) # Fitting the model require(gamlss) mod <- gamlss(y ~ 1, family="LIN") # Extracting the fitted values for mu # using the inverse link function exp(coef(mod, what='mu')) # Example 2 # Generating random values under some model n <- 100 x1 <- runif(n=n) x2 <- runif(n=n) eta <- 1 + 3 * x1 - 2 * x2 mu <- exp(eta) y <- rLIN(n=n, mu=mu) mod <- gamlss(y ~ x1 + x2, family=LIN) coef(mod, what='mu')# Example 1 # Generating some random values with # known mu, sigma and nu y <- rLIN(n=200, mu=2) # Fitting the model require(gamlss) mod <- gamlss(y ~ 1, family="LIN") # Extracting the fitted values for mu # using the inverse link function exp(coef(mod, what='mu')) # Example 2 # Generating random values under some model n <- 100 x1 <- runif(n=n) x2 <- runif(n=n) eta <- 1 + 3 * x1 - 2 * x2 mu <- exp(eta) y <- rLIN(n=n, mu=mu) mod <- gamlss(y ~ x1 + x2, family=LIN) coef(mod, what='mu')
Auxiliary function to compute the log-likelihood of the GL2 distribution.
logLik_GL2(param = c(0, 0), x)logLik_GL2(param = c(0, 0), x)
param |
Numeric vector containing the values of the parameters |
x |
Numeric vector containing the observations. |
y <- rGL2(n = 100, mu = 3, sigma = 1.2) logLik_GL2(param = c(0, 0), x = y)y <- rGL2(n = 100, mu = 3, sigma = 1.2) logLik_GL2(param = c(0, 0), x = y)
The Log-Weibull distribution
LW(mu.link = "identity", sigma.link = "log")LW(mu.link = "identity", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Log-Weibull Distribution with parameters mu
and sigma has density given by
for .
Returns a gamlss.family object which can be used to fit a LW distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Gumbel, E. J. (1958). Statistics of extremes. Columbia university press.
# Example 1 # Generating some random values with # known mu and sigma y <- rLW(n=100, mu=0, sigma=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family= 'LW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function coef(mod, 'mu') exp(coef(mod, 'sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- 1.5 - 3 * x1 sigma <- exp(1.4 - 2 * x2) x <- rLW(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=LW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")# Example 1 # Generating some random values with # known mu and sigma y <- rLW(n=100, mu=0, sigma=1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family= 'LW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function coef(mod, 'mu') exp(coef(mod, 'sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- 1.5 - 3 * x1 sigma <- exp(1.4 - 2 * x2) x <- rLW(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=LW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")
The ages at death in weeks for male mice exposed to 240r of gamma radiation.
data(mice)data(mice)
A vector with 208 data points.
data(mice) hist(mice, main="", xlab="Time (weeks)", freq=FALSE) lines(density(mice), col="blue", lwd=2)data(mice) hist(mice, main="", xlab="Time (weeks)", freq=FALSE) lines(density(mice), col="blue", lwd=2)
The Marshall-Olkin Extended Inverse Weibull family
MOEIW(mu.link = "log", sigma.link = "log", nu.link = "log")MOEIW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Marshall-Olkin Extended Inverse Weibull distribution with parameters mu,
sigma and nu has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a MOEIW distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Okasha, H. M., El-Baz, A. H., Tarabia, A. M. K., & Basheer, A. M. (2017). Extended inverse Weibull distribution with reliability application. Journal of the Egyptian Mathematical Society, 25(3), 343-349.
# Example 1 # Generating some random values with # known mu, sigma and nu set.seed(123456) y <- rMOEIW(n=100, mu=0.6, sigma=1.7, nu=0.3) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family="MOEIW", control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ MOEIW gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-2.02 + 3 * x1) # 0.60 approximately sigma <- exp(2.23 - 2 * x2) # 3.42 approximately nu <- 2 y <- rMOEIW(n=n, mu=mu, sigma=sigma, nu=nu) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=100) mod <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~1, family=MOEIW, data=dat, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu set.seed(123456) y <- rMOEIW(n=100, mu=0.6, sigma=1.7, nu=0.3) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family="MOEIW", control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ MOEIW gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-2.02 + 3 * x1) # 0.60 approximately sigma <- exp(2.23 - 2 * x2) # 3.42 approximately nu <- 2 y <- rMOEIW(n=n, mu=mu, sigma=sigma, nu=nu) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) dat <- gendat(n=100) mod <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~1, family=MOEIW, data=dat, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The Marshall-Olkin Extended Weibull family
MOEW(mu.link = "log", sigma.link = "log", nu.link = "log")MOEW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Marshall-Olkin Extended Weibull distribution with parameters mu,
sigma and nu has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a MOEW distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Ghitany, M. E., Al-Hussaini, E. K., & Al-Jarallah, R. A. (2005). Marshall–Olkin extended Weibull distribution and its application to censored data. Journal of Applied Statistics, 32(10), 1025-1034.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rMOEW(n=400, mu=0.5, sigma=0.7, nu=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='MOEW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-1.20 + 3 * x1) sigma <- exp(0.84 - 2 * x2) nu <- 1 x <- rMOEW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=MOEW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rMOEW(n=400, mu=0.5, sigma=0.7, nu=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='MOEW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-1.20 + 3 * x1) sigma <- exp(0.84 - 2 * x2) nu <- 1 x <- rMOEW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=MOEW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The Marshall-Olkin Kappa family
MOK(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")MOK(mu.link = "log", sigma.link = "log", nu.link = "log", tau.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
tau.link |
defines the tau.link, with "log" link as the default for the tau parameter. |
The Marshall-Olkin Kappa distribution with parameters mu,
sigma, nu and tau has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a MOK distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Javed, M., Nawaz, T., & Irfan, M. (2019). The Marshall-Olkin kappa distribution: properties and applications. Journal of King Saud University-Science, 31(4), 684-691.
# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rMOK(n=100, mu = 1, sigma = 3.5, nu = 3, tau = 2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=MOK, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.5 + x1) sigma <- exp(0.8 + x2) nu <- 1 tau <- 0.5 x <- rMOK(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=MOK, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))# Example 1 # Generating some random values with # known mu, sigma, nu and tau y <- rMOK(n=100, mu = 1, sigma = 3.5, nu = 3, tau = 2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, tau.fo=~1, family=MOK, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma, nu and tau # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) exp(coef(mod, what='tau')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(0.5 + x1) sigma <- exp(0.8 + x2) nu <- 1 tau <- 0.5 x <- rMOK(n=n, mu, sigma, nu, tau) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, tau.fo=~1, family=MOK, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu")) exp(coef(mod, what="tau"))
#' The Modified Weibull distribution
MW(mu.link = "log", sigma.link = "log", nu.link = "log")MW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Modified Weibull distribution with parameters mu,
sigma and nu has density given by
for , , and .
Returns a gamlss.family object which can be used to fit a MW distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Lai, C. D., Xie, M., & Murthy, D. N. P. (2003). A modified Weibull distribution. IEEE Transactions on reliability, 52(1), 33-37.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rMW(n=100, mu = 2, sigma = 1.5, nu = 0.2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family= 'MW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- rpois(n, lambda=2) x2 <- runif(n) mu <- exp(3 -1 * x1) sigma <- exp(2 - 2 * x2) nu <- 0.2 x <- rMW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=MW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what='nu')# Example 1 # Generating some random values with # known mu, sigma and nu y <- rMW(n=100, mu = 2, sigma = 1.5, nu = 0.2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family= 'MW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- rpois(n, lambda=2) x2 <- runif(n) mu <- exp(3 -1 * x1) sigma <- exp(2 - 2 * x2) nu <- 0.2 x <- rMW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=MW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what='nu')
This function can be used to modify OW gamlss.family object
in order to set a customized region search for gamlss() function.
myOW_region(family = OW, valid.values = "auto", initVal)myOW_region(family = OW, valid.values = "auto", initVal)
family |
The |
valid.values |
a list of character elements specifying the region for
|
initVal |
An |
This function was created to help users to fit OW distribution easily
bounding the parametric space for sigma and nu.
The valid.values must be defined as a list of characters containing a call
of the all function.
Returns a gamlss.family object which can be used to fit an OW
distribution in the gamlss() function.
Jaime Mosquera Gutiérrez [email protected]
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rOW(n=200, mu=0.2, sigma=4, nu=0.05) # Custom search region myvalues <- list(sigma="all(sigma > 1)", nu="all(nu < 1) & all(nu < 1)") my_initial_guess <- initValuesOW(formula=y~1) summary(my_initial_guess) # OW family modified with 'myOW_region' require(gamlss) myOW <- myOW_region(valid.values=myvalues, initVal=my_initial_guess) mod1 <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, sigma.start=param.startOW('sigma', my_initial_guess), nu.start=param.startOW('nu', my_initial_guess), control=gamlss.control(n.cyc=300, trace=FALSE), family=myOW) exp(coef(mod1, what='mu')) exp(coef(mod1, what='sigma')) exp(coef(mod1, what='nu')) # Example 2 # Same example using another link function and using 'myOW_region' # in the argument 'family' mod2 <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, sigma.start=2, nu.start=0.1, control=gamlss.control(n.cyc=300, trace=FALSE), family=myOW_region(family=OW(sigma.link='identity'), valid.values=myvalues, initVal=my_initial_guess)) exp(coef(mod2, what='mu')) coef(mod2, what='sigma') exp(coef(mod2, what='nu'))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rOW(n=200, mu=0.2, sigma=4, nu=0.05) # Custom search region myvalues <- list(sigma="all(sigma > 1)", nu="all(nu < 1) & all(nu < 1)") my_initial_guess <- initValuesOW(formula=y~1) summary(my_initial_guess) # OW family modified with 'myOW_region' require(gamlss) myOW <- myOW_region(valid.values=myvalues, initVal=my_initial_guess) mod1 <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, sigma.start=param.startOW('sigma', my_initial_guess), nu.start=param.startOW('nu', my_initial_guess), control=gamlss.control(n.cyc=300, trace=FALSE), family=myOW) exp(coef(mod1, what='mu')) exp(coef(mod1, what='sigma')) exp(coef(mod1, what='nu')) # Example 2 # Same example using another link function and using 'myOW_region' # in the argument 'family' mod2 <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, sigma.start=2, nu.start=0.1, control=gamlss.control(n.cyc=300, trace=FALSE), family=myOW_region(family=OW(sigma.link='identity'), valid.values=myvalues, initVal=my_initial_guess)) exp(coef(mod2, what='mu')) coef(mod2, what='sigma') exp(coef(mod2, what='nu'))
The function NEE() defines the New Exponentiated Exponential distribution, a two parameter
distribution, for a gamlss.family object to be used in GAMLSS fitting
using the function gamlss().
NEE(mu.link = "log", sigma.link = "log")NEE(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "logit" link as the default for the sigma. |
The New Exponentiated Exponential distribution with parameters mu
and sigma has density given by
for , and .
Note: In this implementation we changed the original parameters
for and for ,
we did it to implement this distribution within gamlss framework.
Returns a gamlss.family object which can be used to fit a
NEE distribution in the gamlss() function.
Hassan, Anwar, I. H. Dar, and M. A. Lone. "A New Class of Probability Distributions With An Application to Engineering Data." Pakistan Journal of Statistics and Operation Research 20.2 (2024): 217-231.
# Example 1 # Generating some random values with # known mu and sigma y <- rNEE(n=500, mu=2.5, sigma=3.5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=NEE, control=gamlss.control(n.cyc=5000, trace=TRUE)) # Extracting the fitted values for mu, sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values under some model gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-0.2 + 1.5 * x1) sigma <- exp(1 - 0.7 * x2) y <- rNEE(n=n, mu, sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) datos <- gendat(n=500) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=NEE, data=datos, control=gamlss.control(n.cyc=5000, trace=TRUE)) summary(mod2) # Example 3 -------------------------------------------------- # Obtained from Hassan (2024) page 226 # The data set consists of 63 observations of the gauge lengths of 10mm. y <- c(1.901, 2.132, 2.203, 2.228, 2.257, 2.350, 2.361, 2.396, 2.397, 2.445, 2.454, 2.474, 2.518, 2.522, 2.525, 2.532, 2.575, 2.614, 2.616, 2.618, 2.624, 2.659, 2.675, 2.738, 2.740, 2.856, 2.917, 2.928, 2.937, 2.937, 2.977, 2.996, 3.030, 3.125, 3.139, 3.145, 3.220, 3.223, 3.235, 3.243, 3.264, 3.272, 3.294, 3.332, 3.346, 3.377, 3.408, 3.435, 3.493, 3.501, 3.537, 3.554, 3.562, 3.628, 3.852, 3.871, 3.886, 3.971, 4.024, 4.027, 4.225, 4.395, 5.020) mod3 <- gamlss(y~1, family=NEE) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Hist and estimated pdf hist(y, freq=FALSE, ylim=c(0, 0.7)) curve(dNEE(x, mu=2.076862, sigma=255.2289), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(y)) curve(pNEE(x, mu=2.076862, sigma=255.2289), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(y, rNEE(n=length(y), mu=2.076862, sigma=255.2289), col="tomato") qqline(y, distribution=function(p) qNEE(p, mu=2.076862, sigma=255.2289)) # Example 4 -------------------------------------------------- # Obtained from Hassan (2024) page 226 # The dataset was reported by Bader and Priest (1982) on failure # stresses (in GPa) of 65 single carbon fibers of lengths 50 mm y <- c(0.564, 0.729, 0.802, 0.95, 1.053, 1.111, 1.115, 1.194, 1.208, 1.216, 1.247, 1.256, 1.271, 1.277, 1.305, 1.313, 1.348, 1.39, 1.429, 1.474, 1.49, 1.503, 1.52, 1.522, 1.524, 1.551, 1.551, 1.609, 1.632, 1.632, 1.676, 1.684, 1.685, 1.728, 1.74, 1.761, 1.764, 1.785, 1.804, 1.816, 1.824, 1.836, 1.879, 1.883, 1.892, 1.898, 1.934, 1.947, 1.976, 2.02, 2.023, 2.05, 2.059, 2.068, 2.071, 2.098, 2.13, 2.204, 2.317, 2.334, 2.34, 2.346, 2.378, 2.483, 2.269) mod4 <- gamlss(y~1, family=NEE) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma")) hist(y, freq=FALSE) curve(dNEE(x, mu=2.400515, sigma=25.15236), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(y)) curve(pNEE(x, mu=2.400515, sigma=25.15236), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(y, rNEE(n=length(y), mu=2.400515, sigma=25.15236), col="tomato") qqline(y, distribution=function(p) qNEE(p, mu=2.400515, sigma=25.15236)) # Example 5 ------------------------------------------------------------------- # 69 Observations of the gauge lengths of 20m. y <- c(1.312,1.314,1.479,1.552,1.700,1.803,1.861,1.865,1.944,1.958,1.966,1.997, 2.006,2.021,2.027,2.055, 2.063,2.098,2.140,2.179,2.224,2.240,2.253,2.270, 2.272,2.274,2.301,2.301,2.359,2.382,2.382,2.426, 2.434,2.435,2.478,2.490, 2.511,2.514,2.535,2.554,2.566,2.570,2.586,2.629,2.633,2.642,2.648,2.684, 2.697,2.726,2.770,2.773,2.800,2.809,2.818,2.821,2.848,2.880,2.954,3.012, 3.067,3.084,3.090,3.096, 3.128,3.233,3.433,3.585,3.585) mod5 <- gamlss(y~1, sigma.fo=~1, family = NEE) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod5, what="mu")) exp(coef(mod5, what="sigma")) hist(y, freq=FALSE) curve(dNEE(x, mu=2.197771, sigma=100.8888), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(y)) curve(pNEE(x, mu=2.197771, sigma=100.8888), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(y, rNEE(n=length(y), mu=2.197771, sigma=100.8888), col="tomato") qqline(y, distribution=function(p) qNEE(p, mu=2.197771, sigma=100.8888))# Example 1 # Generating some random values with # known mu and sigma y <- rNEE(n=500, mu=2.5, sigma=3.5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, family=NEE, control=gamlss.control(n.cyc=5000, trace=TRUE)) # Extracting the fitted values for mu, sigma # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values under some model gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-0.2 + 1.5 * x1) sigma <- exp(1 - 0.7 * x2) y <- rNEE(n=n, mu, sigma) data.frame(y=y, x1=x1, x2=x2) } set.seed(123) datos <- gendat(n=500) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=NEE, data=datos, control=gamlss.control(n.cyc=5000, trace=TRUE)) summary(mod2) # Example 3 -------------------------------------------------- # Obtained from Hassan (2024) page 226 # The data set consists of 63 observations of the gauge lengths of 10mm. y <- c(1.901, 2.132, 2.203, 2.228, 2.257, 2.350, 2.361, 2.396, 2.397, 2.445, 2.454, 2.474, 2.518, 2.522, 2.525, 2.532, 2.575, 2.614, 2.616, 2.618, 2.624, 2.659, 2.675, 2.738, 2.740, 2.856, 2.917, 2.928, 2.937, 2.937, 2.977, 2.996, 3.030, 3.125, 3.139, 3.145, 3.220, 3.223, 3.235, 3.243, 3.264, 3.272, 3.294, 3.332, 3.346, 3.377, 3.408, 3.435, 3.493, 3.501, 3.537, 3.554, 3.562, 3.628, 3.852, 3.871, 3.886, 3.971, 4.024, 4.027, 4.225, 4.395, 5.020) mod3 <- gamlss(y~1, family=NEE) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod3, what="mu")) exp(coef(mod3, what="sigma")) # Hist and estimated pdf hist(y, freq=FALSE, ylim=c(0, 0.7)) curve(dNEE(x, mu=2.076862, sigma=255.2289), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(y)) curve(pNEE(x, mu=2.076862, sigma=255.2289), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(y, rNEE(n=length(y), mu=2.076862, sigma=255.2289), col="tomato") qqline(y, distribution=function(p) qNEE(p, mu=2.076862, sigma=255.2289)) # Example 4 -------------------------------------------------- # Obtained from Hassan (2024) page 226 # The dataset was reported by Bader and Priest (1982) on failure # stresses (in GPa) of 65 single carbon fibers of lengths 50 mm y <- c(0.564, 0.729, 0.802, 0.95, 1.053, 1.111, 1.115, 1.194, 1.208, 1.216, 1.247, 1.256, 1.271, 1.277, 1.305, 1.313, 1.348, 1.39, 1.429, 1.474, 1.49, 1.503, 1.52, 1.522, 1.524, 1.551, 1.551, 1.609, 1.632, 1.632, 1.676, 1.684, 1.685, 1.728, 1.74, 1.761, 1.764, 1.785, 1.804, 1.816, 1.824, 1.836, 1.879, 1.883, 1.892, 1.898, 1.934, 1.947, 1.976, 2.02, 2.023, 2.05, 2.059, 2.068, 2.071, 2.098, 2.13, 2.204, 2.317, 2.334, 2.34, 2.346, 2.378, 2.483, 2.269) mod4 <- gamlss(y~1, family=NEE) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod4, what="mu")) exp(coef(mod4, what="sigma")) hist(y, freq=FALSE) curve(dNEE(x, mu=2.400515, sigma=25.15236), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(y)) curve(pNEE(x, mu=2.400515, sigma=25.15236), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(y, rNEE(n=length(y), mu=2.400515, sigma=25.15236), col="tomato") qqline(y, distribution=function(p) qNEE(p, mu=2.400515, sigma=25.15236)) # Example 5 ------------------------------------------------------------------- # 69 Observations of the gauge lengths of 20m. y <- c(1.312,1.314,1.479,1.552,1.700,1.803,1.861,1.865,1.944,1.958,1.966,1.997, 2.006,2.021,2.027,2.055, 2.063,2.098,2.140,2.179,2.224,2.240,2.253,2.270, 2.272,2.274,2.301,2.301,2.359,2.382,2.382,2.426, 2.434,2.435,2.478,2.490, 2.511,2.514,2.535,2.554,2.566,2.570,2.586,2.629,2.633,2.642,2.648,2.684, 2.697,2.726,2.770,2.773,2.800,2.809,2.818,2.821,2.848,2.880,2.954,3.012, 3.067,3.084,3.090,3.096, 3.128,3.233,3.433,3.585,3.585) mod5 <- gamlss(y~1, sigma.fo=~1, family = NEE) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod5, what="mu")) exp(coef(mod5, what="sigma")) hist(y, freq=FALSE) curve(dNEE(x, mu=2.197771, sigma=100.8888), add=TRUE, col="tomato", lwd=2) # Empirical cdf and estimated ecdf plot(ecdf(y)) curve(pNEE(x, mu=2.197771, sigma=100.8888), add=TRUE, col="tomato", lwd=2) # QQplot qqplot(y, rNEE(n=length(y), mu=2.197771, sigma=100.8888), col="tomato") qqline(y, distribution=function(p) qNEE(p, mu=2.197771, sigma=100.8888))
The function OW() defines the Odd Weibull distribution, a three parameter
distribution, for a gamlss.family object to be used in GAMLSS fitting
using the function gamlss().
OW(mu.link = "log", sigma.link = "log", nu.link = "log")OW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu. |
The odd Weibull with parameters mu, sigma and nu
has density given by
for .
Returns a gamlss.family object which can be used to fit a OW distribution in the gamlss() function.
Jaime Mosquera Gutiérrez [email protected]
Cooray, K. (2006). Generalization of the Weibull distribution: the odd Weibull family. Statistical Modelling, 6(3), 265-277.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rOW(n=200, mu=0.1, sigma=7, nu = 1.1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family="OW", control=gamlss.control(n.cyc=500, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) x3 <- runif(n) mu <- exp(1.2 + 2 * x1) sigma <- 2.12 + 3 * x2 nu <- exp(0.2 - x3) y <- rOW(n=n, mu, sigma, nu) mod <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~x3, family=OW(sigma.link="identity"), control=gamlss.control(n.cyc=300, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what="nu")# Example 1 # Generating some random values with # known mu, sigma and nu y <- rOW(n=200, mu=0.1, sigma=7, nu = 1.1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family="OW", control=gamlss.control(n.cyc=500, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what="mu")) exp(coef(mod, what="sigma")) exp(coef(mod, what="nu")) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) x3 <- runif(n) mu <- exp(1.2 + 2 * x1) sigma <- 2.12 + 3 * x2 nu <- exp(0.2 - x3) y <- rOW(n=n, mu, sigma, nu) mod <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~x3, family=OW(sigma.link="identity"), control=gamlss.control(n.cyc=300, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what="nu")
This function can be used to extract initial values found with empirical
time on test transform (TTT) through initValuesOW function.
This is used for parameter estimation in OW distribution.
param.startOW(param, initValOW)param.startOW(param, initValOW)
param |
a character used to specify the parameter required. It can take the
values |
initValOW |
an |
This function just gets initial values computed with initValuesOW
for OW family. It must be called in sigma.start and nu.start
arguments from gamlss function. This function is useful only
if user want to set start values automatically with TTT plot.
See example for an illustration.
A length-one vector numeric value corresponding to the initial value of the
parameter specified in param extracted from a initValuesOW
object specified in the initValOW input argument.
Jaime Mosquera Gutiérrez [email protected]
# Random data generation (OW distributed) y <- rOW(n=500, mu=0.05, sigma=0.6, nu=2) # Initial values with TTT plot iv <- initValuesOW(formula = y ~ 1) summary(iv) # This data is from unimodal hazard # See TTT estimate from sample plot(iv, legend_options=list(pos=1.03)) # See the true hazard curve(hOW(x, mu=0.05, sigma=0.6, nu=2), to=100, lwd=3, ylab="h(x)") # Finally, we fit the model require(gamlss) con.out <- gamlss.control(n.cyc = 300, trace = FALSE) con.in <- glim.control(cyc = 300) (sigma.start <- param.startOW("sigma", iv)) (nu.start <- param.startOW("nu", iv)) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, control=con.out, i.control=con.in, family=myOW_region(OW(sigma.link="identity", nu.link="identity"), valid.values="auto", iv), sigma.start=sigma.start, nu.start=nu.start) # Estimates are close to actual values (mu <- exp(coef(mod, what = "mu"))) (sigma <- coef(mod, what = "sigma")) (nu <- coef(mod, what = "nu"))# Random data generation (OW distributed) y <- rOW(n=500, mu=0.05, sigma=0.6, nu=2) # Initial values with TTT plot iv <- initValuesOW(formula = y ~ 1) summary(iv) # This data is from unimodal hazard # See TTT estimate from sample plot(iv, legend_options=list(pos=1.03)) # See the true hazard curve(hOW(x, mu=0.05, sigma=0.6, nu=2), to=100, lwd=3, ylab="h(x)") # Finally, we fit the model require(gamlss) con.out <- gamlss.control(n.cyc = 300, trace = FALSE) con.in <- glim.control(cyc = 300) (sigma.start <- param.startOW("sigma", iv)) (nu.start <- param.startOW("nu", iv)) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, control=con.out, i.control=con.in, family=myOW_region(OW(sigma.link="identity", nu.link="identity"), valid.values="auto", iv), sigma.start=sigma.start, nu.start=nu.start) # Estimates are close to actual values (mu <- exp(coef(mod, what = "mu"))) (sigma <- coef(mod, what = "sigma")) (nu <- coef(mod, what = "nu"))
Power Lindley distribution
PL(mu.link = "log", sigma.link = "log")PL(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Power Lindley Distribution with parameters mu
and sigma has density given by
for x > 0.
Returns a gamlss.family object which can be used to fit a PL distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Ghitany, M. E., Al-Mutairi, D. K., Balakrishnan, N., & Al-Enezi, L. J. (2013). Power Lindley distribution and associated inference. Computational Statistics & Data Analysis, 64, 20-33.
# Example 1 # Generating some random values with # known mu and sigma y <- rPL(n=100, mu=1.5, sigma=0.2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family= 'PL', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod, 'mu')) exp(coef(mod, 'sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1.2 - 2 * x1) sigma <- exp(0.8 - 3 * x2) x <- rPL(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=PL, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")# Example 1 # Generating some random values with # known mu and sigma y <- rPL(n=100, mu=1.5, sigma=0.2) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family= 'PL', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod, 'mu')) exp(coef(mod, 'sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1.2 - 2 * x1) sigma <- exp(0.8 - 3 * x2) x <- rPL(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=PL, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")
The Quasi XGamma Poisson family
QXGP(mu.link = "log", sigma.link = "log", nu.link = "log")QXGP(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Quasi XGamma Poisson distribution with parameters mu,
sigma and nu has density given by
for , , , .
where
Returns a gamlss.family object which can be used to fit a QXGP distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Sen, S., Korkmaz, M. Ç., & Yousof, H. M. (2018). The quasi XGamma-Poisson distribution: properties and application. Istatistik Journal of The Turkish Statistical Association, 11(3), 65-76.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rQXGP(n=200, mu=4, sigma=2, nu=3) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='QXGP', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 2000 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-2.19 + 3 * x1) sigma <- exp(1 - 2 * x2) nu <- 1 x <- rQXGP(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=QXGP, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rQXGP(n=200, mu=4, sigma=2, nu=3) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='QXGP', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 2000 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(-2.19 + 3 * x1) sigma <- exp(1 - 2 * x2) nu <- 1 x <- rQXGP(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=QXGP, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
Reflected Weibull distribution
RW(mu.link = "log", sigma.link = "log")RW(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
The Reflected Weibull Distribution with parameters mu
and sigma has density given by
for y < 0
Returns a gamlss.family object which can be used to fit a RW distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Cohen, A. C. (1973). The reflected Weibull distribution. Technometrics, 15(4), 867-873.
# Example 1 # Generating some random values with # known mu and sigma y <- rRW(n=100, mu=1, sigma=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family= 'RW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod, 'mu')) exp(coef(mod, 'sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1.5 - 1.5 * x1) sigma <- exp(2 - 2 * x2) x <- rRW(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=RW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")# Example 1 # Generating some random values with # known mu and sigma y <- rRW(n=100, mu=1, sigma=1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, family= 'RW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu and sigma # using the inverse link function exp(coef(mod, 'mu')) exp(coef(mod, 'sigma')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(1.5 - 1.5 * x1) sigma <- exp(2 - 2 * x2) x <- rRW(n=n, mu, sigma) mod <- gamlss(x~x1, sigma.fo=~x2, family=RW, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma")
initValOW objectsThis summary method displays initial values and search regions
for OW family.
## S3 method for class 'initValOW' summary(object, ...)## S3 method for class 'initValOW' summary(object, ...)
object |
an object of class |
... |
extra arguments |
No return value, it just prints out in the console the initial values and the
search regions for and from OW distribution (see
dOW).
Jaime Mosquera Gutiérrez [email protected]
The Sarhan and Zaindin's Modified Weibull distribution
SZMW(mu.link = "log", sigma.link = "log", nu.link = "log")SZMW(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Sarhan and Zaindin's Modified Weibull distribution with parameters mu,
sigma and nu has density given by
for , , and .
Returns a gamlss.family object which can be used to fit a SZMW distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Almalki, S. J., & Nadarajah, S. (2014). Modifications of the Weibull distribution: A review. Reliability Engineering & System Safety, 124, 32-55.
Sarhan, A. M., & Zaindin, M. (2009). Modified Weibull distribution. APPS. Applied Sciences, 11, 123-136.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rSZMW(n=100, mu = 1, sigma = 1, nu = 1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='SZMW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(-1.6 * x1) sigma <- exp(0.9 - 1 * x2) nu <- 1.5 x <- rSZMW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=SZMW, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what='nu')# Example 1 # Generating some random values with # known mu, sigma and nu y <- rSZMW(n=100, mu = 1, sigma = 1, nu = 1.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='SZMW', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(-1.6 * x1) sigma <- exp(0.9 - 1 * x2) nu <- 1.5 x <- rSZMW(n=n, mu, sigma, nu) mod <- gamlss(x~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=SZMW, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what='nu')
The function WALD() defines the wALD distribution, two-parameter
continuous distribution for a gamlss.family object to be used in GAMLSS fitting
using the function gamlss().
WALD(mu.link = "log", sigma.link = "log")WALD(mu.link = "log", sigma.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma parameter. |
The Wald distribution with parameters and has density given by
Returns a gamlss.family object which can be used to fit a WALD distribution in the gamlss() function.
Sofia Cuartas García, [email protected]
Heathcote, A. (2004). Fitting Wald and ex-Wald distributions to response time data: An example using functions for the S-PLUS package. Behavior Research Methods, Instruments, & Computers, 36, 678-694.
# Example 1 # Generating random values with # known mu and sigma require(gamlss) mu <- 1.5 sigma <- 4.0 y <- rWALD(10000, mu, sigma) mod1 <- gamlss(y~1, sigma.fo=~1, family="WALD", control=gamlss.control(n.cyc=5000, trace=TRUE)) exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ WALD gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.75 - 0.69 * x1) # Approx 1.5 sigma <- exp(0.5 - 0.64 * x2) # Approx 1.20 y <- rWALD(n, mu, sigma) data.frame(y=y, x1=x1, x2=x2) } dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=WALD, data=dat, control=gamlss.control(n.cyc=5000, trace=TRUE)) summary(mod2)# Example 1 # Generating random values with # known mu and sigma require(gamlss) mu <- 1.5 sigma <- 4.0 y <- rWALD(10000, mu, sigma) mod1 <- gamlss(y~1, sigma.fo=~1, family="WALD", control=gamlss.control(n.cyc=5000, trace=TRUE)) exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) # Example 2 # Generating random values under some model # A function to simulate a data set with Y ~ WALD gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(0.75 - 0.69 * x1) # Approx 1.5 sigma <- exp(0.5 - 0.64 * x2) # Approx 1.20 y <- rWALD(n, mu, sigma) data.frame(y=y, x1=x1, x2=x2) } dat <- gendat(n=200) mod2 <- gamlss(y~x1, sigma.fo=~x2, family=WALD, data=dat, control=gamlss.control(n.cyc=5000, trace=TRUE)) summary(mod2)
The Weibull Geometric distribution
WG(mu.link = "log", sigma.link = "log", nu.link = "logit")WG(mu.link = "log", sigma.link = "log", nu.link = "logit")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The weibull geometric distribution with parameters mu,
sigma and nu has density given by
for , , and .
Returns a gamlss.family object which can be used to fit a WG distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Barreto-Souza, W., de Morais, A. L., & Cordeiro, G. M. (2011). The Weibull-geometric distribution. Journal of Statistical Computation and Simulation, 81(5), 645-657.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rWG(n=100, mu = 0.9, sigma = 2, nu = 0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='WG', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(- 0.2 * x1) sigma <- exp(1.2 - 1 * x2) nu <- 0.5 x <- rWG(n=n, mu, sigma, nu) mod <- gamlss(x~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=WG, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what='nu')# Example 1 # Generating some random values with # known mu, sigma and nu y <- rWG(n=100, mu = 0.9, sigma = 2, nu = 0.5) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='WG', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 200 x1 <- runif(n) x2 <- runif(n) mu <- exp(- 0.2 * x1) sigma <- exp(1.2 - 1 * x2) nu <- 0.5 x <- rWG(n=n, mu, sigma, nu) mod <- gamlss(x~x1, mu.fo=~x1, sigma.fo=~x2, nu.fo=~1, family=WG, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") coef(mod, what='nu')
The Weigted Generalized Exponential-Exponential family
WGEE(mu.link = "log", sigma.link = "log", nu.link = "log")WGEE(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Weigted Generalized Exponential-Exponential distribution with parameters mu,
sigma and nu has density given by
for , , and .
Returns a gamlss.family object which can be used to fit a WGEE distribution in the gamlss() function.
Johan David Marin Benjumea, [email protected]
Mahdavi, A. (2015). Two weighted distributions generated by exponential distribution. Journal of Mathematical Extension, 9, 1-12.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rWGEE(n=1000, mu = 5, sigma = 0.5, nu = 1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='WGEE', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(2 - x1) sigma <- exp(1 - 3*x2) nu <- 1 x <- rWGEE(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=WGEE, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rWGEE(n=1000, mu = 5, sigma = 0.5, nu = 1) # Fitting the model require(gamlss) mod <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family='WGEE', control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod, what='mu')) exp(coef(mod, what='sigma')) exp(coef(mod, what='nu')) # Example 2 # Generating random values under some model n <- 500 x1 <- runif(n, min=0.4, max=0.6) x2 <- runif(n, min=0.4, max=0.6) mu <- exp(2 - x1) sigma <- exp(1 - 3*x2) nu <- 1 x <- rWGEE(n=n, mu, sigma, nu) mod <- gamlss(x~x1, sigma.fo=~x2, nu.fo=~1, family=WGEE, control=gamlss.control(n.cyc=50000, trace=FALSE)) coef(mod, what="mu") coef(mod, what="sigma") exp(coef(mod, what="nu"))
The Weibull Poisson family
WP(mu.link = "log", sigma.link = "log", nu.link = "log")WP(mu.link = "log", sigma.link = "log", nu.link = "log")
mu.link |
defines the mu.link, with "log" link as the default for the mu parameter. |
sigma.link |
defines the sigma.link, with "log" link as the default for the sigma. |
nu.link |
defines the nu.link, with "log" link as the default for the nu parameter. |
The Weibull Poisson distribution with parameters mu,
sigma and nu has density given by
for .
Returns a gamlss.family object which can be used to fit a WP distribution in the gamlss() function.
Amylkar Urrea Montoya, [email protected]
Lu, Wanbo, and Daimin Shi. "A new compounding life distribution: the Weibull–Poisson distribution." Journal of applied statistics 39.1 (2012): 21-38.
# Example 1 # Generating some random values with # known mu, sigma and nu y <- rWP(n=3000, mu=1.5, sigma=0.5, nu=0.5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family=WP, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) exp(coef(mod1, what="nu")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ WP gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-1.3 + 3.1 * x1) sigma <- exp(0.9 - 3.2 * x2) nu <- 0.5 y <- rWP(n=n, mu, sigma, nu) data.frame(y=y, x1=x1, x2) } set.seed(1234) dat <- gendat(n=100) # Fitting the model mod2 <- NULL mod2 <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~1, family=WP, data=dat, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod2, what="mu") coef(mod2, what="sigma") exp(coef(mod2, what="nu"))# Example 1 # Generating some random values with # known mu, sigma and nu y <- rWP(n=3000, mu=1.5, sigma=0.5, nu=0.5) # Fitting the model require(gamlss) mod1 <- gamlss(y~1, sigma.fo=~1, nu.fo=~1, family=WP, control=gamlss.control(n.cyc=5000, trace=FALSE)) # Extracting the fitted values for mu, sigma and nu # using the inverse link function exp(coef(mod1, what="mu")) exp(coef(mod1, what="sigma")) exp(coef(mod1, what="nu")) # Example 2 # Generating random values for a regression model # A function to simulate a data set with Y ~ WP gendat <- function(n) { x1 <- runif(n) x2 <- runif(n) mu <- exp(-1.3 + 3.1 * x1) sigma <- exp(0.9 - 3.2 * x2) nu <- 0.5 y <- rWP(n=n, mu, sigma, nu) data.frame(y=y, x1=x1, x2) } set.seed(1234) dat <- gendat(n=100) # Fitting the model mod2 <- NULL mod2 <- gamlss(y~x1, sigma.fo=~x2, nu.fo=~1, family=WP, data=dat, control=gamlss.control(n.cyc=5000, trace=FALSE)) coef(mod2, what="mu") coef(mod2, what="sigma") exp(coef(mod2, what="nu"))