spRMM_SEM {mixtools} | R Documentation |
Stochastic EM algorithm for semiparametric scaled mixture of censored data
Description
Stochastic EM algorithm for semiparametric scaled mixture for randomly right censored data.
Usage
spRMM_SEM(t, d = NULL, lambda = NULL, scaling = NULL,
centers = 2, kernelft = triang_wkde,
bw = rep(bw.nrd0(t),length(t)), averaged = TRUE,
epsilon = 1e-08, maxit = 100, batchsize = 1, verb = FALSE)
Arguments
t |
A vector of |
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 |
scaling |
Initial value of scaling between components,
set to 1 if |
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 |
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 |
hazard |
Hazard rate last iteration estimate evaluated at |
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 |
batch.t |
Batch sample (not ordered), see reference. |
batch.d |
Associated event indicators just |
sumNaNs |
Internal control of numerical stability. |
ft |
A character vector giving the name of the function. |
Author(s)
Didier Chauveau
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
See Also
Related functions:
plotspRMM
,
summary.spRMM
.
Other models and algorithms for censored lifetime data
(name convention is model_algorithm):
expRMM_EM
,
weibullRMM_SEM
.
Examples
## Not run:
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"
## End(Not run)