estdweibull: Estimation of parameters

Description Usage Arguments Value Author(s) See Also Examples

View source: R/estdweibull.R

Description

Estimation of the parameters of the type 1 discrete Weibull distribution

Usage

1
estdweibull(x, method = "ML", zero = FALSE, eps = 1e-04, nmax=1000)

Arguments

x

the vector of sample values

method

"ML" for the maximum likelihood method; "M" for the method of moments; "P" for the method of proportions

zero

TRUE, if the support contains 0; FALSE otherwise

eps

error threshold for the computation of the moments of the distribution

nmax

maximum value considered for the numerical computation of the expected value

Value

the vector of the estimates of q and β

Author(s)

Alessandro Barbiero

See Also

ddweibull

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Ex1
n <- 10
q <- 0.5
beta <- 0.8
x <- rdweibull(n, q, beta)
estdweibull(x, "ML") # maximum likelihood method
# it may return some harmless warnings
# that depend on the optimization function used in the maximization routine
estdweibull(x, "M") # method of moments
estdweibull(x, "P") # method of proportion
# the estimates provided by the three methods may be quite different
# from the true values... and to each other
# change the sample size
n <- 50
q <- 0.5
beta <- 0.8
x <- rdweibull(n, q, beta)
estdweibull(x, "ML") # maximum likelihood method
estdweibull(x, "M") # method of moments
estdweibull(x, "P") # method of proportion
# the estimates should be (on average) closer to the true values
# ...and to each other

# When the estimation methods fail...
# Ex2
# only 1s and 2s
x <- c(1,1,1,1,1,1,2,2,2,2)
estdweibull(x, "ML") # fails!
estdweibull(x, "M") # fails!
estdweibull(x, "P") # fails!

# Ex3
# no 1s
x <- c(2,2,3,4,5,5,5,6,6,8,10)
estdweibull(x, "ML") # works
estdweibull(x, "M") # works
estdweibull(x, "P") # fails!

DiscreteWeibull documentation built on May 2, 2019, 8:58 a.m.