| Title: | Zero-Inflated Discrete Weibull Models |
|---|---|
| Description: | Parameter estimation for zero-inflated discrete Weibull (ZIDW) regression models, the univariate setting, distribution functions, functions to generate randomized quantile residuals a pseudo R2, and plotting of rootograms. For more details, see Kalktawi (2017) <https://bura.brunel.ac.uk/handle/2438/14476>, Taconeli and Rodrigues de Lara (2022) <doi:10.1080/00949655.2021.2005597>, and Yeh and Young (2025) <doi:10.1080/03610918.2025.2464076>. |
| Authors: | Peng Yeh [aut], Derek S. Young [aut, cre] (ORCID: <https://orcid.org/0000-0002-3048-3803>) |
| Maintainer: | Derek S. Young <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.0 |
| Built: | 2026-06-08 08:32:10 UTC |
| Source: | https://github.com/dsy109/zidw |
Parameter estimation for zero-inflated discrete Weibull (ZIDW) regression models, the univariate setting, distribution functions, functions to generate randomized quantile residuals a pseudo R2, and plotting of rootograms.
| Package: | ZIDW |
| Type: | Package |
| Version: | 0.1.0 |
| Date: | 2025-09-22 |
| Imports: | DWreg, actuar, maxLik, COUNT, gtools, matrixcalc, DiscreteWeibull, dplyr, ggplot2, purrr, tibble |
| License: | GPL (>= 2) |
Peng Yeh, Ph.D.
Derek S. Young, Ph.D.
Maintainer: Derek S. Young <[email protected]>
Kalktawi, H. S. (2017), Discrete Weibull Regression Model for Count Data. Ph.D. Thesis, Brunel University London.
Taconeli, C. A. and Rodrigues de Lara, I. A. (2022), Discrete Weibull Distribution: Different Estimation Methods Under Ranked Set Sampling and Simple Random Sampling. Journal of Statistical Computation and Simulation, 92:8, 1740–1762.
Yeh, P. and Young, D. S. (2025), Some Estimation and Inference Considerations for the Zero-Inflated Discrete Weibull Distribution. Communications in Statistics - Simulation and Computation (in press), 1–22.
Generic function calculating AIC or BIC for ZIDW model fits.
## S3 method for class 'zidw' AIC(object, ..., k = 2) ## S3 method for class 'zidw' BIC(object, ...)## S3 method for class 'zidw' AIC(object, ..., k = 2) ## S3 method for class 'zidw' BIC(object, ...)
object |
A fitted ZIDW model object for which there exists a |
... |
Optionally more fitted model objects. |
k |
Numeric value for the penalty per parameter to be used; default = 2. |
A numeric value with the corresponding AIC or BIC.
Sakamoto, Y., Ishiguro, M., and Kitagawa G. (1986), Akaike Information Criterion Statistics. D. Reidel Publishing Company.
## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) AIC(zidw_out) BIC(zidw_out)## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) AIC(zidw_out) BIC(zidw_out)
Perform the bootstrap likelihood ratio test for comparing DW and ZIDW model fits.
bootstrap_lrt(data, B, tol = -1)bootstrap_lrt(data, B, tol = -1)
data |
Data to test. |
B |
Number of bootstrap samples to draw. |
tol |
Threshold of bootstrap likelihood ratio test statistics. See details. |
Theoretically, the likelihood ratio is always positive. In practice, however, if a negative (but close to zero) likelihood ratio occurrs, then the calculations are typically numerically unstable or the fitting procedure failed to converge to the MLEs. We, therefore, set the threshold to -1 by default.
If the bootstrap likelihood ratio is less than tol, we drop this sample and resample. If it is between tol and 0, we truncate it at 0.
Return a list containing four vectors:
pvalue |
P-value of the test. |
Observe likelihood ratio test statistics |
Likelihood ratio test statistics from the data. |
Bootstrap likelihood ratio test statistics |
Bootstrap likelihood ratio test statistics. |
count |
Number of times that bootstrap LRT is less than |
## data data("rwm1984", package = 'COUNT') set.seed(1) test <- suppressWarnings(bootstrap_lrt(rwm1984, B = 20)) test## data data("rwm1984", package = 'COUNT') set.seed(1) test <- suppressWarnings(bootstrap_lrt(rwm1984, B = 20)) test
Print the coefficients of a ZIDW object.
## S3 method for class 'zidw' coef(object, ...)## S3 method for class 'zidw' coef(object, ...)
object |
A ZIDW object to extract the model coefficients. |
... |
Further arguments. |
Coefficients extracted from the ZIDW object object. This will be a named numeric vector.
## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) coef.zidw(zidw_out)## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) coef.zidw(zidw_out)
This dataset contains the number of cases from 2020 Summer Olympics and 2020 Summer Paralympics in Tokyo.
data(covid)data(covid)
This data frame consists of 5 variables on 70 dates:
date Date of recording the number of cases of COVID-19.
athlete Number of cases for athletes.
staff Number of cases for staff.
volunteer Number of cases for volunteers.
total Total number of cases.
Wikipedia contributors. (2022, December 5). COVID-19 cases at the 2020 Summer Olympics and 2020 Summer Paralympics. In Wikipedia, The Free Encyclopedia. Retrieved 13:01, December 20, 2022, https://en.wikipedia.org/wiki/COVID-19_cases_at_the_2020_Summer_Olympics_and_2020_Summer_Paralympics#cite_note-Tokyo2020CovidList-1
Density, distribution function, quantile function and random generation for the hurdle Discrete Weibull distribution with parameter , and hurdle crossing probability (i.e., is the probability for observed zeros).
dhdw(x, q_par, beta, lam, log = FALSE) phdw(q, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) qhdw(p, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) rhdw(n, q_par, beta, lam)dhdw(x, q_par, beta, lam, log = FALSE) phdw(q, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) qhdw(p, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) rhdw(n, q_par, beta, lam)
x, q
|
Vector of quantiles. |
p |
Vector of probabilities. |
n |
Number of observation. |
q_par |
Shape parameter. |
beta |
Shape parameter. |
lam |
Zero-infation parameter. |
log, log.p
|
Logical; if |
lower.tail |
Logical; if |
The hurdle discrete Weibull has the mass function
,
for where is the zero-inflation parameter, , and .
dhdw |
Gives the density. |
phdw |
Gives the cumulative probability. |
qhdw |
Gives the quantile value. |
rhdw |
Generates random numbers. |
Kalktawi, H. S. (2017), Discrete Weibull Regression Model for Count Data. Ph.D. Thesis, Brunel University London.
Yeh, P. and Young, D. S. (2025), Some Estimation and Inference Considerations for the Zero-Inflated Discrete Weibull Distribution. Communications in Statistics - Simulation and Computation (in press), 1–22.
dhdw(.5, .6, 1, .4) phdw(.5, .6, 1, .4) qhdw(.8, .6, 1, .4) rhdw(100, .6, 1, .4)dhdw(.5, .6, 1, .4) phdw(.5, .6, 1, .4) qhdw(.8, .6, 1, .4) rhdw(100, .6, 1, .4)
Extract the log-likelihood of a ZIDW model fit.
## S3 method for class 'zidw' logLik(object, ...)## S3 method for class 'zidw' logLik(object, ...)
object |
A fitted ZIDW model object for which there exists a |
... |
Some methods for this generic function require additional arguments. |
A numeric value with the corresponding log-likelihood.
## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) logLik(zidw_out)## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) logLik(zidw_out)
Obtains predictions from the fitted ZIDW model object.
## S3 method for class 'zidw' predict(object, newdata, type = c("response", "prob", "count", "zero"), at = NULL, ...)## S3 method for class 'zidw' predict(object, newdata, type = c("response", "prob", "count", "zero"), at = NULL, ...)
object |
A fitted object of class inheriting from |
newdata |
Optionally, a data frame in which to look for variables with which to predict. If omitted, the fitted predictors are used. |
type |
The type of prediction required. For details see below. |
at |
Optionally, if |
... |
Currently not used. |
The default is type = "response", which is on the scale of the response variable.
type = "prob" provides the predicted density (i.e., probabilities for the observed counts).
type = "count" offers the predicted mean from the count component without zero-inflation and type = "zero" predicts the probability for the zero-component.
If type = "response", a vector of estimated conditional mean values from the ZIDW model is returned.
If type = "prob", a matrix of predicted probabilities is returned, where each row is a vector of predicted probabilities over the range of
responses seen in the data (i.e., min(y):max(y)). If type = "count", a vector of the predicted means from the count component (without zero-inflation) is returned.
If type = "zero", the predicted probability for the zero-component is returned.
## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) predict.zidw(zidw_out)## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) predict.zidw(zidw_out)
Print the output of a ZIDW object.
## S3 method for class 'zidw' print(x, digits = max(3, getOption("digits") - 3), ...)## S3 method for class 'zidw' print(x, digits = max(3, getOption("digits") - 3), ...)
x |
A ZIDW object used to select a method. |
digits |
Minimal number of significant digits. |
... |
Further arguments passed to or from other methods. |
Returns an object of class zidw based on the object x with mostly the same output when printing output from
an object of class lm. Whereas an lm object has one model.matrix in its output,
use of print.zidw returns three model matrices, one each for the model parameters and as well as for the
zero-inflation component.
## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) print(zidw_out)## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) print(zidw_out)
A rootogram is a model diagnostic tool that assesses the goodness-of-fit of a statistical model. The rootogram is drawn using ggplot2::ggplot() graphics.
rootogram_zidw(object, type = c("hanging", "standing", "suspended"), sqrt = TRUE, ref_line = TRUE, warn_limits = TRUE, fitted_colour = "steelblue", bar_colour = NA, bar_fill = "grey", ref_line_colour = "black", warn_line_colour = "black", ylab = NULL, xlab = NULL, ...)rootogram_zidw(object, type = c("hanging", "standing", "suspended"), sqrt = TRUE, ref_line = TRUE, warn_limits = TRUE, fitted_colour = "steelblue", bar_colour = NA, bar_fill = "grey", ref_line_colour = "black", warn_line_colour = "black", ylab = NULL, xlab = NULL, ...)
object |
A ZIDW model object. |
type |
Type of rootogram; default is |
sqrt |
Logical; show the observed and fitted frequencies (default is |
ref_line |
Logical; draw a reference line at zero (default is |
warn_limits |
Logical; draw Tukey's warning limit lines at +/- 1 (default is |
fitted_colour, bar_colour, bar_fill, ref_line_colour, warn_line_colour
|
Colors used to draw the respective element of the rootogram. |
xlab, ylab
|
Character; labels for the x and y axis of the rootogram. May be missing ( |
... |
Arguments passed to other methods. |
A ggplot object.
Kleiber, C. and Zeileis, A. (2016). Visualizing Count Data Regressions Using Rootograms. The American Statistician, 70:3, 296–303.
## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) rootogram_zidw(zidw_out)## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) rootogram_zidw(zidw_out)
Calculate randomized quantile residuals from a ZIDW regression fit.
rqres_zidw_reg(test, plot = FALSE)rqres_zidw_reg(test, plot = FALSE)
test |
Zero-inflated discrete Weibull regresssion output. |
plot |
If |
Return a vector of randomized quantile resuduals or a randomized quantile residuals plot:
rqr |
Randomized quantile resuduals. |
Dunn, P. K. and Smyth, G. K. (1996), Randomzied Quantile Residuals. Journal of Computational and Graphical Statistics, 5:3, 236–244.
Yeh, P. and Young, D. S. (2025), Some Estimation and Inference Considerations for the Zero-Inflated Discrete Weibull Distribution. Communications in Statistics - Simulation and Computation (in press), 1–22.
## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) rqr <- rqres_zidw_reg(zidw_out)## data data("rwm1984", package = 'COUNT') zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) rqr <- rqres_zidw_reg(zidw_out)
summary method to produce results for objects of class "zidw".
## S3 method for class 'zidw' summary(object, ...) ## S3 method for class 'summary.zidw' print(x, digits = max(3, getOption("digits") - 3), ...)## S3 method for class 'zidw' summary(object, ...) ## S3 method for class 'summary.zidw' print(x, digits = max(3, getOption("digits") - 3), ...)
object |
An object of class |
... |
Additional arguments affecting the summary produced. |
x |
A |
digits |
The number of digits in the output. |
Additional information about the ZIDW fit represented by object is extracted and included as components of
object. The returned object has a print method.
Currently, limited results from an object of class "zidw" is returned. The output is of class summary.zidw.
Future versions of this code will attempt to mimic summary.glm.
## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) summary(zidw_out)## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) summary(zidw_out)
Density, distribution function, quantile function and random generation for the zero-inflated Discrete Weibull distribution with parameters , , .
dzidw(x, q_par, beta, lam, log = FALSE) pzidw(q, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) qzidw(p, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) rzidw(n, q_par, beta, lam)dzidw(x, q_par, beta, lam, log = FALSE) pzidw(q, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) qzidw(p, q_par, beta, lam, lower.tail = TRUE, log.p = FALSE) rzidw(n, q_par, beta, lam)
x, q
|
Vector of quantiles. |
p |
Vector of probabilities. |
n |
Number of observation. |
q_par |
Shape parameter. |
beta |
Shape parameter. |
lam |
Zero-infation parameter. |
log, log.p
|
Logical; if |
lower.tail |
Logical; if |
The zero-inflated discrete Weibull has the mass function
,
for where is zero-inflation parameter, , and .
dzidw |
Gives the density. |
pzidw |
Gives the cumulative probability. |
qzidw |
Gives the quantile value. |
rzidw |
Generates random numbers. |
Kalktawi, H. S. (2017), Discrete Weibull Regression Model for Count Data. Ph.D. Thesis, Brunel University London.
Yeh, P. and Young, D. S. (2025), Some Estimation and Inference Considerations for the Zero-Inflated Discrete Weibull Distribution. Communications in Statistics - Simulation and Computation (in press), 1–22.
dzidw(.5, .6, 1, .4) pzidw(.5, .6, 1, .4) qzidw(.8, .6, 1, .4) rzidw(100, .6, 1, .4)dzidw(.5, .6, 1, .4) pzidw(.5, .6, 1, .4) qzidw(.8, .6, 1, .4) rzidw(100, .6, 1, .4)
for ZIDW RegressionCalculates the pseudo- for ZIDW regression fits. Modeling and .
zidw_r_squared(object, adj = TRUE)zidw_r_squared(object, adj = TRUE)
object |
An object from a ZIDW regression fit of class |
adj |
An adjustment for calculating the pseudo- |
A numerical value with the corresponding pseudo-.
Martin, J. and Hall, D. B. (2016), Measures for Zero-Inflated Regression Models for Count Data with Excess Zeros. Journal of Statistical Computation and Simulation, 84:18, 3777–3790.
## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) zidw_r_squared(zidw_out)## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) zidw_r_squared(zidw_out)
Fitting of the zero-inflated discrete Weibull regression model is done via constrOptim. Fitting of the univariate model can be accomplished via maximum likelihood or minimum distance estimation.
zidw_reg(qformula, betaformula = ~ 1, ziformula = ~ 1, data, lam = NULL, beta = NULL, q = NULL, k = 1000, uni_method = c('MLE', 'mde'), max_method = NULL, constraint = TRUE, B = NULL)zidw_reg(qformula, betaformula = ~ 1, ziformula = ~ 1, data, lam = NULL, beta = NULL, q = NULL, k = 1000, uni_method = c('MLE', 'mde'), max_method = NULL, constraint = TRUE, B = NULL)
qformula |
A symbolic description of the model to be fitted for the parameter |
betaformula |
A symbolic description of the model to be fitted for the parameter |
ziformula |
a symbolic description of the model to be fitted for the parameter |
data |
A data frame containg model variables. |
lam |
The starting value for |
beta |
The starting value for parameter |
q |
The starting value for parameter |
k |
A cutofff value used to calculate residuals. |
uni_method |
The univariate fitting method. Methods include |
max_method |
Maximum likelihood estimation method for the univariate setting. See maxLik for the different methods. |
constraint |
Set |
B |
Number of bootstrap replciates for standard error estimation when modeling univariate data using |
zidw_reg An object of class "zidw", i.e., a list with components including the following:
call |
The original function call. |
coefficients |
A list with elements "zero", "beta", and "q" containing the coefficients from the respective models. |
loglik |
The log-likehood of the fitted model. |
SE |
Estimated standard errors. |
convergence |
The convergence code of |
nall |
The number of observations. |
res |
A vector of raw residuals (observed - fitted). |
fitted_values |
The fitted values. |
model_matrix_q |
The model matrix of parameter |
model_matrix_beta |
The model matrix of parameter |
model_matrix_zi |
The model matrix of parameter |
response |
Vector of response values. |
model |
The dataset. |
formula |
A list containing three formulas for |
Taconeli, C. A. and Rodrigues de Lara, I. A. (2022), Discrete Weibull Distribution: Different Estimation Methods Under Ranked Set Sampling and Simple Random Sampling. Journal of Statistical Computation and Simulation, 92:8, 1740–1762.
Yeh, P. and Young, D. S. (2025), Some Estimation and Inference Considerations for the Zero-Inflated Discrete Weibull Distribution. Communications in Statistics - Simulation and Computation (in press), 1–22.
## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) ## model without covariates zidw_out2 <- zidw_reg(docvis ~ 1, data = rwm1984)## data data("rwm1984", package = 'COUNT') ## model with covariates zidw_out <- zidw_reg(docvis ~ outwork + female + age, ziformula = ~ age + female, betaformula = ~ 1, data = rwm1984[1:100, ], beta = .1) ## model without covariates zidw_out2 <- zidw_reg(docvis ~ 1, data = rwm1984)
Parameter estimation for the univariate zero-inflated discrete Weibull distribution using maximum likelihood or minimum distance estimation.
zidw_uni(y, par = NULL, method = c('MLE', 'mde'), B = NULL, max_method = NULL, constraint = TRUE)zidw_uni(y, par = NULL, method = c('MLE', 'mde'), B = NULL, max_method = NULL, constraint = TRUE)
y |
Vector of univariate counts. |
par |
Vector of starting values in the order of |
method |
Parameter estimation method. Methods include |
B |
Number of bootstrap replciates for standard error estimation when modeling univariate data using |
max_method |
Maximum likelihood estimation method for the univariate setting. See maxLik for the different methods. |
constraint |
Logical value to constrain the parameter to be within the parameter space. Default is |
Output for for maximum likelihood estimation (uni_method = 'MLE'):
MLE |
Maximum likelihood estimates. |
coefficients |
Coefficients for |
convergence |
Convergence code of |
iteration |
Number of iterations. |
SE |
Estimated standard errors. |
Output for for minimum distance estimation (uni_method = 'MDE'):
lam |
Parameter estimate for |
Beta |
Parameter estimate for |
q |
Parameter estimate for |
distance |
The final distance value. |
SE |
Bootstrap standard error estimates for |
Taconeli, C. A. and Rodrigues de Lara, I. A. (2022), Discrete Weibull Distribution: Different Estimation Methods Under Ranked Set Sampling and Simple Random Sampling. Journal of Statistical Computation and Simulation, 92:8, 1740–1762.
Yeh, P. and Young, D. S. (2025), Some Estimation and Inference Considerations for the Zero-Inflated Discrete Weibull Distribution. Communications in Statistics - Simulation and Computation (in press), 1–22.
## data data("rwm1984", package = 'COUNT') ## MLE method zidw_out <- zidw_uni(rwm1984$docvis) ## mde without standard error estimation set.seed(1) zidw_out2 <- zidw_uni(rwm1984$docvis, method = 'mde') ## mde with bootstrap standard error estimation set.seed(1) zidw_out2 <- zidw_uni(rwm1984$docvis, method = 'mde', B = 5)## data data("rwm1984", package = 'COUNT') ## MLE method zidw_out <- zidw_uni(rwm1984$docvis) ## mde without standard error estimation set.seed(1) zidw_out2 <- zidw_uni(rwm1984$docvis, method = 'mde') ## mde with bootstrap standard error estimation set.seed(1) zidw_out2 <- zidw_uni(rwm1984$docvis, method = 'mde', B = 5)
Density, distribution function, quantile function and random generation for the zero-truncated Discrete Weibull distribution with parameter , .
dztdw(x, q_par, beta, log = FALSE) pztdw(q, q_par, beta, lower.tail = TRUE, log.p = FALSE) qztdw(p, q_par, beta, lower.tail = TRUE, log.p = FALSE) rztdw(n, q_par, beta)dztdw(x, q_par, beta, log = FALSE) pztdw(q, q_par, beta, lower.tail = TRUE, log.p = FALSE) qztdw(p, q_par, beta, lower.tail = TRUE, log.p = FALSE) rztdw(n, q_par, beta)
x, q
|
Vector of quantiles. |
p |
Vector of probabilities. |
n |
Number of observation. |
q_par |
Shape parameter. |
beta |
Shape parameter. |
log, log.p
|
Logical; if |
lower.tail |
Logical; if |
The zero-truncated discrete Weibull has the mass function
,
for where , and .
dztdw |
Gives the density. |
pztdw |
Gives the cumulative probability. |
qztdw |
Gives the quantile value. |
rztdw |
Generates random numbers. |
Kalktawi, H. S. (2017), Discrete Weibull Regression Model for Count Data. Ph.D. Thesis, Brunel University London.
Yeh, P. and Young, D. S. (2025), Some Estimation and Inference Considerations for the Zero-Inflated Discrete Weibull Distribution. Communications in Statistics - Simulation and Computation (in press), 1–22.
dztdw(1, .6, 1) pztdw(1, .6, 1) qztdw(.8, .6, 1) rztdw(100, .6, 1)dztdw(1, .6, 1) pztdw(1, .6, 1) qztdw(.8, .6, 1) rztdw(100, .6, 1)