Title: | Discrete Inverse Weibull Distribution |
---|---|
Description: | Probability mass function, distribution function, quantile function, random generation and parameter estimation for the discrete inverse Weibull distribution. |
Authors: | Alessandro Barbiero, Riccardo Inchingolo, Mario Samigli |
Maintainer: | Alessandro Barbiero <[email protected]> |
License: | GPL |
Version: | 1.0.2 |
Built: | 2024-11-20 06:22:50 UTC |
Source: | CRAN |
Probability mass function, distribution function, quantile function, random generation and parameter estimation for the discrete inverse Weibull distribution
Package: | DiscreteInverseWeibull |
Type: | Package |
Version: | 1.0.2 |
Date: | 2016-04-29 |
License: | GPL |
LazyLoad: | yes |
Depends: | Rsolnp |
Alessandro Barbiero <[email protected]>, Riccardo Inchingolo <[email protected]>, Mario Samigli <[email protected]>
Jazi M.A., Lai C.-D., Alamatsaz M.H. (2010) A discrete inverse Weibull distribution and estimation of its parameters, Statistical Methodology 7: 121-132
Khan M.S., Pasha G.R., Pasha A.H. (2008) Theoretical Analysis of Inverse Weibull Distribution, WSEAS Trabsactions on Mathematics 2(7): 30-38
Drapella A. (1993) Complementary Weibull distribution: unknown or just forgotten, Quality Reliability Engineering International 9: 383-385
Dutang, C., Goulet, V., Pigeon, M. (2008) actuar: An R package for actuarial science, Journal of Statistical Software 25(7): 1-37
Alternative hazard rate function for the discrete inverse Weibull distribution
ahrdiweibull(x, q, beta)
ahrdiweibull(x, q, beta)
x |
a vector of values |
q |
the value of the |
beta |
the value of the |
The alternative hazard rate function is defined as
the value of the alternative hazard rate function in the x
values
q<-0.5 beta<-2 x<-1:10 y<-ahrdiweibull(x, q, beta) y plot(x,y,ylab="alt.hazard rate")
q<-0.5 beta<-2 x<-1:10 y<-ahrdiweibull(x, q, beta) y plot(x,y,ylab="alt.hazard rate")
Probability mass function, distribution function, quantile function and random generation for the discrete inverse Weibull distribution with parameters and
ddiweibull(x, q, beta) pdiweibull(x, q, beta) qdiweibull(p, q, beta) rdiweibull(n, q, beta)
ddiweibull(x, q, beta) pdiweibull(x, q, beta) qdiweibull(p, q, beta) rdiweibull(n, q, beta)
x |
a vector of quantiles |
p |
a vector of probabilities |
q |
the value of the first parameter, |
beta |
the value of the second parameter, |
n |
the sample size |
The discrete inverse Weibull distribution has probability mass function given by ,
,
. Its cumulative distribution function is
ddiweibull
gives the probability, pdiweibull
gives the distribution function, qdiweibull
gives the quantile function, and rdiweibull
generates random values. See the reference below for the continuous inverse Weibull distribution.
Dutang, C., Goulet, V., Pigeon, M. (2008) actuar: An R package for actuarial science, Journal of Statistical Software 25(7): 1-37
# Ex.1 x<-1:10 q<-0.6 beta<-0.8 ddiweibull(x, q, beta) t<-qdiweibull(0.99, q, beta) t pdiweibull(t, q, beta) # Ex.2 q<-0.4 beta<-1.7 n<-100 x<-rdiweibull(n, q, beta) tabulate(x)/sum(tabulate(x)) y<-1:round(max(x)) # compare with ddiweibull(y, q, beta)
# Ex.1 x<-1:10 q<-0.6 beta<-0.8 ddiweibull(x, q, beta) t<-qdiweibull(0.99, q, beta) t pdiweibull(t, q, beta) # Ex.2 q<-0.4 beta<-1.7 n<-100 x<-rdiweibull(n, q, beta) tabulate(x)/sum(tabulate(x)) y<-1:round(max(x)) # compare with ddiweibull(y, q, beta)
First and second order moments of the discrete inverse Weibull distribution
Ediweibull(q, beta, eps = 1e-04, nmax = 1000)
Ediweibull(q, beta, eps = 1e-04, nmax = 1000)
q |
the value of the |
beta |
the value of the |
eps |
error threshold for the approximated computation of the moments |
nmax |
a first maximum value of the support considered for the approximated computation of the moments |
For a discrete inverse Weibull distribution we have and
.
The expected values are numerically computed considering a truncated support: integer values smaller than or equal to
, where
is the inverse of the cumulative distribution function (implemented by the function
qdiweibull
). Increasing the value of nmax
or decreasing the value of eps
improves the approximation, but slows down the calculation speed
a list comprising the (approximate) first and second order moments of the discrete inverse Weibull distribution. Note that the first moment is finite iff is greater than 1; the second order moment is finite iff
is greater than 2
Khan M.S., Pasha G.R., Pasha A.H. (2008) Theoretical Analysis of Inverse Weibull Distribution, WSEAS Trabsactions on Mathematics 2(7): 30-38
# Ex.1 q<-0.75 beta<-1.25 Ediweibull(q, beta) # Ex.2 q<-0.5 beta<-2.5 Ediweibull(q, beta) # Ex.3 q<-0.4 beta<-4 Ediweibull(q, beta)
# Ex.1 q<-0.75 beta<-1.25 Ediweibull(q, beta) # Ex.2 q<-0.5 beta<-2.5 Ediweibull(q, beta) # Ex.3 q<-0.4 beta<-4 Ediweibull(q, beta)
Sample estimation of the parameters of the discrete inverse Weibull distribution
estdiweibull(x, method="P", control=list())
estdiweibull(x, method="P", control=list())
x |
a vector of sample values |
method |
the estimation method that will be carried out: |
control |
a list of additional parameters:
|
For a description of the methods, have a look at the reference. Note that they may be not applicable to some specific samples. For examples, the method of proportion cannot be applied if there are no 1s in the samples; it cannot be applied for estimating if all the sample values are
. The method of moments cannot be applied for estimating
if all the sample values are
; besides, it may return unreliable results since the first and second moments can be computed only if
. The heuristic method cannot be applied for estimating
if all the sample values are
.
a vector containing the two estimates of and
n<-100 q<-0.5 beta<-2.5 # generation of a sample x<-rdiweibull(n, q, beta) # sample estimation through each of the implemented methods estdiweibull(x, method="P") estdiweibull(x, method="M") estdiweibull(x, method="H") estdiweibull(x, method="PP")
n<-100 q<-0.5 beta<-2.5 # generation of a sample x<-rdiweibull(n, q, beta) # sample estimation through each of the implemented methods estdiweibull(x, method="P") estdiweibull(x, method="M") estdiweibull(x, method="H") estdiweibull(x, method="PP")
Heuristic method for the estimation of parameters of the discrete inverse Weibull
heuristic(x, beta1=1, z = 0.1, r = 0.1, Leps = 0.01)
heuristic(x, beta1=1, z = 0.1, r = 0.1, Leps = 0.01)
x |
a vector of sample values |
beta1 |
launch value of the |
z |
initial value of width |
r |
initial value of rate |
Leps |
tolerance error for the likelihood function |
For a detailed description of the method, have a look at the reference
a list containig the two estimates of and
Jazi M.A., Lai C.-D., Alamatsaz M.H. (2010) A discrete inverse Weibull distribution and estimation of its parameters, Statistical Methodology, 7: 121-132
Drapella A. (1993) Complementary Weibull distribution: unknown or just forgotten, Quality Reliability Engineering International 9: 383-385
n<-50 q<-0.25 beta<-1.5 x<-rdiweibull(n, q, beta) # estimates using the heuristic algorithm par0<-heuristic(x) par0 # change the default values of some working parameters... par1<-heuristic(x, beta1=2) par1 par2<-heuristic(x, z=0.5) par2 par3<-heuristic(x, r=0.2) par3 par4<-heuristic(x, Leps=0.1) par4 # ...there should be just light differences among the estimates... # ... and among the corresponding values of the loglikelihood functions loglikediw(x, par0[1], par0[2]) loglikediw(x, par1[1], par1[2]) loglikediw(x, par2[1], par2[2]) loglikediw(x, par3[1], par3[2]) loglikediw(x, par4[1], par4[2])
n<-50 q<-0.25 beta<-1.5 x<-rdiweibull(n, q, beta) # estimates using the heuristic algorithm par0<-heuristic(x) par0 # change the default values of some working parameters... par1<-heuristic(x, beta1=2) par1 par2<-heuristic(x, z=0.5) par2 par3<-heuristic(x, r=0.2) par3 par4<-heuristic(x, Leps=0.1) par4 # ...there should be just light differences among the estimates... # ... and among the corresponding values of the loglikelihood functions loglikediw(x, par0[1], par0[2]) loglikediw(x, par1[1], par1[2]) loglikediw(x, par2[1], par2[2]) loglikediw(x, par3[1], par3[2]) loglikediw(x, par4[1], par4[2])
Hazard rate function for the discrete inverse Weibull distribution
hrdiweibull(x, q, beta)
hrdiweibull(x, q, beta)
x |
a vector of values |
q |
the value of the |
beta |
the value of the |
The hazard rate function is defined as
the hazard rate function computed on the x
values
q<-0.5 beta<-2.5 x<-1:10 hrdiweibull(x, q, beta)
q<-0.5 beta<-2.5 x<-1:10 hrdiweibull(x, q, beta)
Log-likelihood function of the discrete inverse Weibull
loglikediw(x, q, beta)
loglikediw(x, q, beta)
x |
a vector of sample values |
q |
the value of the |
beta |
the value of the |
the value of the log-likelihood function (changed in sign) of the discrete inverse Weibull distribution with parameters and
computed on a sample x
n<-100 q<-0.4 beta<-2 x<-rdiweibull(n, q, beta) # loglikelihood function (changed in sign) computed on the true values loglikediw(x, q, beta) par<-estdiweibull(x, method="H") par # loglikelihood function (changed in sign) computed on the ML estimates loglikediw(x, par[1], par[2]) # it should be smaller than before...
n<-100 q<-0.4 beta<-2 x<-rdiweibull(n, q, beta) # loglikelihood function (changed in sign) computed on the true values loglikediw(x, q, beta) par<-estdiweibull(x, method="H") par # loglikelihood function (changed in sign) computed on the ML estimates loglikediw(x, par[1], par[2]) # it should be smaller than before...
Quadratic loss function for the method of moments
lossdiw(x, par, eps = 1e-04, nmax=1000)
lossdiw(x, par, eps = 1e-04, nmax=1000)
x |
a vector of sample values |
par |
a vector of parameters ( |
eps |
a tolerance error for the computation of first order moments |
nmax |
a first maximum value for the computation of first order moments |
the value of the quadratic loss function where
and
are the first and second order sample moments.
n<-100 q<-0.5 beta<-2.5 x<-rdiweibull(n, q, beta) # loss function computed on the true values lossdiw(x, c(q, beta)) par<-estdiweibull(x, method="M") # estimates of the parameters through the method of moments par # loss function computed on the estimates derived through # the method of moments lossdiw(x, par) # it should be zero (however, smaller than before...)
n<-100 q<-0.5 beta<-2.5 x<-rdiweibull(n, q, beta) # loss function computed on the true values lossdiw(x, c(q, beta)) par<-estdiweibull(x, method="M") # estimates of the parameters through the method of moments par # loss function computed on the estimates derived through # the method of moments lossdiw(x, par) # it should be zero (however, smaller than before...)