ddiweibull: The discrete inverse Weibull distribution

Description Usage Arguments Details Value References Examples

Description

Probability mass function, distribution function, quantile function and random generation for the discrete inverse Weibull distribution with parameters q and β

Usage

1
2
3
4

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, β)=q^{x^{-β}}

Value

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# 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)

Example output

Loading required package: Rsolnp
 [1] 0.600000000 0.145729551 0.063140427 0.036053164 0.023600691 0.016775663
 [7] 0.012602209 0.009850939 0.007934724 0.006542840
[1] 136
[1] 0.9900169
[1] 0.36 0.35 0.18 0.07 0.03 0.00 0.01
[1] 0.400000000 0.354257427 0.113749456 0.048851444 0.025471713 0.015036590
[7] 0.009664266

DiscreteInverseWeibull documentation built on May 2, 2019, 4:20 a.m.