Probability mass function, distribution function, quantile function and random generation for the discrete inverse Weibull distribution with parameters q and β
ddiweibull(x, q, beta)pdiweibull(x, q, beta)qdiweibull(p, q, beta)rdiweibull(n, q, beta)
Arguments
x: a vector of quantiles
p: a vector of probabilities
q: the value of the first parameter, q
beta: the value of the second parameter, β
n: the sample size
Details
The discrete inverse Weibull distribution has probability mass function given by P(X=x;q,β)=q(x)−β−q(x−1)β, x=1,2,3,…, 0<q<1,β>0. Its cumulative distribution function is F(x;q,β)=qx−β
Returns
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.
References
Dutang, C., Goulet, V., Pigeon, M. (2008) actuar: An R package for actuarial science, Journal of Statistical Software 25(7): 1-37
Examples
# Ex.1x<-1:10q<-0.6beta<-0.8ddiweibull(x, q, beta)t<-qdiweibull(0.99, q, beta)t
pdiweibull(t, q, beta)# Ex.2q<-0.4beta<-1.7n<-100x<-rdiweibull(n, q, beta)tabulate(x)/sum(tabulate(x))y<-1:round(max(x))# compare withddiweibull(y, q, beta)