This vignette presents the fitWD() function, which is
used to estimate the parameters of the two-parameter Weibull
Distribution (WD) using several estimation methods, including maximum
likelihood (ML), least squares (LS), weighted least squares (WLS), and
maximum product of spacings (MPS).
A random variable
is said to follow a two-parameter WD its cumulative distribution
function (CDF) and probability density function (PDF) are given by
and
where
,
is the scale parameter and
is a shape parameter.
Let a random sample from
are observed as
.
For all estimation methods, optimization is performed using
stats::optim.
The MLEs are obtained by maximizing the log-likelihood function:
The LSE is obtained by minimizing the squared differences between the theoretical and empirical CDF values at the ordered sample points.
Let denote the ordered samples. The objective function is:
The WLSE extends LSE by introducing weights: where
The MPS estimates are obtained by maximizing: where and .
fitWD()
To illustrate the use of fitWD(), we consider a
simulated example.
# Load the package
library(SSReliabilityClaytonMWD)
# generate data from MWD(a, b, lambda) with lambda = 0 reduces two-parameter Weibull distribution
n <- 50
a <- 0.75; b <- 1.25; lambda <- 0
set.seed(123)
dat <- rMweibull(n, a, b, lambda)
# random initial points
init <- runif(2)MLE of the parameters:
# Fit WD to `dat`
fit.mle <- fitWD(data = dat, est.method = "mle", opt.method = "L-BFGS-B", starts = init,
lower = c(1e-05,1e-05), upper = c(Inf,Inf), hessian = FALSE )
fit.mle$estimates
#> a b
#> 0.675279 1.283785LSE of the parameters:
fit.lse <- fitWD(data = dat, est.method = "lse", opt.method = "L-BFGS-B", starts = init,
lower = c(1e-05,1e-05), upper = c(Inf,Inf), hessian = FALSE )
fit.lse$estimates
#> a b
#> 0.7012337 1.2147202WLSE of the parameters:
fit.wlse <- fitWD(data = dat, est.method = "wlse", opt.method = "L-BFGS-B", starts = init,
lower = c(1e-05,1e-05), upper = c(Inf,Inf), hessian = FALSE )
fit.wlse$estimates
#> a b
#> 0.690969 1.236661MPS of the parameters: