Stochastic EM algorithm for semiparametric scaled mixture of censored data
spRMM_SEM.RdStochastic EM algorithm for semiparametric scaled mixture for randomly right censored data.
Arguments
- t
A vector of \(n\) real positive lifetime (possibly censored) durations. If
dis notNULLthen a vector of random censoring timescoccurred, so that \(x= min(x,c)\) and \(d = I(x <= c)\).- d
The vector of censoring indication, where 1 means observed lifetime data, and 0 means censored lifetime data.
- lambda
Initial value of mixing proportions. If
NULL, thenlambdais set torep(1/k,k).- scaling
Initial value of scaling between components, set to 1 if
NULL.- centers
initial centers for initial call to kmeans for initialization.
- kernelft
.
- bw
Bandwidth in the kernel hazard estimates.
- averaged
averaged.
- epsilon
Tolerance limit.
- maxit
The number of iterations allowed.
- batchsize
The batchsize (see reference below).
- verb
If TRUE, print updates for every iteration of the algorithm as it runs
Value
spRMM_SEM returns a list of class "spRMM" with the following items:
- t
The input data.
- d
The input censoring indicator.
- lambda
The estimates for the mixing proportions.
- scaling
The estimates for the components scaling.
- posterior
An \(n\times k\) matrix of posterior probabilities for observation, after convergence of the algorithm.
- loglik
The (pseudo) log-likelihood value at convergence of the algorithm.
- all.loglik
The sequence of log-likelihood values over iterations.
- all.lambda
The sequence of mixing proportions over iterations.
- all.scaling
The sequence of scaling parameter over iterations.
- meanpost
Posterior probabilities averaged over iterations.
- survival
Kaplan-Meier last iteration estimate (a
stepfunobject).- hazard
Hazard rate last iteration estimate evaluated at
final.t.- final.t
Last iteration unscaled sample (see reference).
- s.hat
Kaplan-Meier average estimate.
- t.hat
Ordered unscaled sample, for testing purpose.
- avg.od
For testing purpose only.
- hazard.hat
Hazard rate average estimate on
t.hat.- batch.t
Batch sample (not ordered), see reference.
- batch.d
Associated event indicators just
rep(d,batchsize), for testing purpose.- sumNaNs
Internal control of numerical stability.
- ft
A character vector giving the name of the function.
See also
Related functions:
plotspRMM,
summary.spRMM.
Other models and algorithms for censored lifetime data
(name convention is model_algorithm):
expRMM_EM,
weibullRMM_SEM.
References
Bordes, L., and Chauveau, D. (2016), Stochastic EM algorithms for parametric and semiparametric mixture models for right-censored lifetime data, Computational Statistics, Volume 31, Issue 4, pages 1513-1538. https://link.springer.com/article/10.1007/s00180-016-0661-7
Examples
if (FALSE) { # \dontrun{
n=500 # sample size
m=2 # nb components
lambda=c(0.4, 0.6) # parameters
meanlog=3; sdlog=0.5; scale=0.1
set.seed(12)
# simulate a scaled mixture of lognormals
x <- rlnormscalemix(n, lambda, meanlog, sdlog, scale)
cs=runif(n,20,max(x)+400) # Censoring (uniform) and incomplete data
t <- apply(cbind(x,cs),1,min)
d <- 1*(x <= cs)
tauxc <- 100*round( 1-mean(d),3)
cat(tauxc, "percents of data censored.\n")
c0 <- c(25, 180) # data-driven initial centers (visible modes)
sc0 <- 25/180 # and scaling
s <- spRMM_SEM(t, d, scaling = sc0, centers = c0, bw = 15, maxit = 100)
plotspRMM(s) # default
summary(s) # S3 method for class "spRMM"
} # }