Description Usage Arguments Details Value Note Author(s) References See Also Examples
EM algorithm to estimate the parameters of a mixture of two two-parameter Weibull distributions for possibly Type-I right censored data. The PDF of this mixture distribution is
f(x) = p (a_1/b_1)(x/b_1)^(a_1-1)exp(-(x/b_1)^a_1) + (1-p)(a_2/b_2)(x/b_2)^(a_2-1)exp(-(x/b_2)^a_2),
p is the proportion of the first sub-population. a_1, a_2 are the shape parameters for the two sub-populations. b_1, b_2 are the scale parameters. More details of the mixture model and this algorithm can be found in Liu (2012).
1 | emCenWbMix.T1(dat, Cx=NULL, iniParam = NULL, useC = FALSE, conCr = 1e-06, nIter = 10000)
|
dat |
The data vector, should not contain any negative observations, but NA is allowed.
The NA's and observations larger than the censoring threshold |
Cx |
The censoring threshold of Type I right-censoring. If NULL, the uncensored mixture will be estimated. |
iniParam |
A vector of length six (p, 1-p, a_1, a_2, b_1, b_2). All the elements must be postive. If not provided, the algorithm will generate them randomly. See |
useC |
See |
conCr |
See |
nIter |
See |
It is well known that the EM algorithm is highly influenced by the initial value of the parameters. We strongly recommend the users provide some proper/reasonable initial values for their data sets. It is usually very difficult for EM algorithm to converge from the random initials generated in this function. Also, it is better to try starting this function from different initial values to obtain a "global" maximum of the likelihood.
convergence |
An integer indicating why the algorithm terminated
|
nllh |
The negative log-likelihood |
estimates |
A 2 by 3 matrix of the parameter estimates: p, a_1, b_1; 1-p, a_2, b_2; |
iniParam |
A copy of the iniParam |
Please report the numerical problems and inconvenience when using this function to the author.
Yang (Seagle) Liu <yang.liu@stat.ubc.ca>
Liu Y. (2012). Lower Quantile Estimation of Wood Strength Data. Master Thesis, Department of Statistics, UBC. Downloadable here.
rweibull
, quanWbMix
, simWbMix
, cenWbMLE.T1
, emCenWbMix.T2
1 2 3 4 5 6 7 8 | mmix = rbind(c(0.7, 5, 7),c(0.3, 15, 6))
vmix = c(mmix) #A vector version of the paramters
set.seed(1)
y <- sort(simWbMix(300, mmix)) #Generate the data
#The uncensored mixture
emCenWbMix.T1(y, iniParam=vmix, useC=TRUE)
#The mixture if we censor the data around 9.
emCenWbMix.T1(y, Cx=9, iniParam=vmix, useC=TRUE)
|
$convergence
[1] 0
$nllh
[1] 511.1865
$estimates
Proportion Shape Scale
Population 1 0.7279865 4.720902 6.888439
Population 2 0.2720135 11.763734 6.115837
$iniParam
[1] 0.7 0.3 5.0 15.0 7.0 6.0
$convergence
[1] 0
$nllh
[1] 507.9849
$estimates
Proportion Shape Scale
Population 1 0.7498951 4.834031 6.866480
Population 2 0.2501049 12.145552 6.091254
$iniParam
[1] 0.7 0.3 5.0 15.0 7.0 6.0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.