Learn R Programming

Renext (version 2.0-0)

fweibull: ML estimation of classical Weibull distribution

Description

Fast Maximum Likelihood estimation of the classical two parameters Weibull distribution

Usage

fweibull(x,
           info.observed = FALSE,
           check.loglik = FALSE)

Arguments

x
Sample vector to be fitted
info.observed
Should the observed information matrix be used or the expected one be used?
check.loglik
If TRUE, the log-likelihood is recomputed using dweibull function with log = TRUE. The result is returned as a list element.

Value

  • A list
  • estimateparameter ML estimates
  • sd(asymptotic) standard deviation for estimate
  • cov(asymptotic) covariance matrix computed from theoretical or observed information matrix
  • etathe estimated value for eta

Details

The ML estimates are obtained thanks to a reparametrisation with $\eta = scale^{1/shape}$ in place of shape. This allows the maximisation of a one-dimensional likelihood $L$ since the $\eta$ parameter can be concentrated out of $L$. This also allows the determination of the expected information matrix for $[shape,\,\eta]$ rather than the usual observed information.

See Also

weibplot for Weibull plots

Examples

Run this code
library(MASS) 
n <- 1000
shape <- 2*runif(1)
x <- 100*rweibull(n, shape = 0.8, scale = 1)
res <- fweibull(x)
res2 <- fitdistr(x , "weibull")
est <- cbind(res$estimate, res2$estimate)
colnames(est) <- c("Renext", "MASS")
loglik <- c(res$loglik, res2$loglik)
est <- rbind(est, loglik)
est
weibplot(x,
         shape = c(res$estimate["shape"], res2$estimate["shape"]),
         scale = c(res$estimate["scale"], res2$estimate["scale"]),
         labels = c("Renext 'fweibull'", "MASS 'fitdistr'"),
         mono = TRUE)

Run the code above in your browser using DataLab