Description Usage Arguments Value Author(s) See Also Examples
Estimation of the parameters of the type 1 discrete Weibull distribution
1 | estdweibull(x, method = "ML", zero = FALSE, eps = 1e-04, nmax=1000)
|
x |
the vector of sample values |
method |
|
zero |
|
eps |
error threshold for the computation of the moments of the distribution |
nmax |
maximum value considered for the numerical computation of the expected value |
the vector of the estimates of q and β
Alessandro Barbiero
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!
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.