This function fits a normal mixture model to progressive Type-II censored mixture data by dealing with the two aspects of missing data, latent mixture components and the censored data, using a maximum likelihood estimation through a constrained two-layer EM algorithm.
pcensmixSim(Pdat, ...)# S3 method for pcgen
pcensmixSim(Pdat, r, p, param, iteration = 1e+05,
INERiter = 20, ...)
an object of class "pcgen" created by function
pcgen or a two-column matrix (or data.frame)
with first column
giving a vector of censored version of a two-component mixed normal data,
and the other one indicating the censoring status associated with them (1
if not censored, otherwise zero).
additinal arguments to pass by.
desired number of failures to observe.
a parameter controlling the amount of censoring. The action of
censoring individuals after each failure occurs with probabilty p
from binomial distribution at each stage. If p = 0, there will be no
censoring.
a numeric vector; used as starting values for the EM and simulating a new data to replace in case of happening singularity in the likelihood.
the maximum number of required iteration for the EM algorithm until convergence-- default value is 1e+05.
the maximum number of required iteration for the second EM algorithm-- default is 20.
pcensmixSim gives an object of class data.frame
containing the following components:
component one parameter estimates (\(\hat\mu_1\), \(\hat\sigma_1\) )
component two parameter estimates (\(\hat\mu_2\), \(\hat{\sigma_2}\)
estimation of mixture proportion \(\hat\pi\)
standard errors of \(\hat\mu_1\) and \(\hat{\sigma_1}\)
standard errors of \(\hat\mu_2\) and \(\hat\sigma_2\)
standard error of \(\hat\pi\)
number of failures from each mixture component
number of censored observations from each mixture component
log-likelihood value
TRUE if data has been replaced by a newly
generated one
This function fits a two-component normal mixture model to simulated progressive Type-II censored data with density function $$\pi (\frac{1}{\sigma_1})\, \phi\!\! \left[\frac{(z - \mu_1)}{\sigma_1}\right] + (1 - \pi) (\frac{1}{\sigma_2})\, \phi\!\! \left[\frac{(z - \mu_2)}{\sigma_2}\right]$$ where \(\phi\) is the standard normal density.
It uses a constrained two-layer EM algorithm to deal with the two forms of missing data: the censored survival times and the mixture component labels. Given the EM algorithm is at a particular iteration: (i) first, in the E-step it obtains the mixture component indicator estimates given the current parameter estimates and the observed data. (ii) Next, for re-estimation of the unknown parameters, a new EM algorithm is nested in the M-step of the initial EM algorithm to deal with the estimation of the missing censored survival times and consequently building the maximum likelihood equations. These steps are repeated until the model converges.
# NOT RUN {
set.seed(100)
Pdat<- pcgen(r = 60, p = 0.3, data = mixgen(N = 100, dist1 = 'norm',
dist2 = 'norm', control = list(12, 2, 14, 5, 0.35)))
pcensmixSim(Pdat, r = 60, p = 0.3, param=c(12, 2, 14, 5, 0.35))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab