Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plotweibullRMM

Plot sequences from the Stochastic EM algorithm for mixture of Weibull


Description

Function for plotting sequences of estimates along iterations, from an object returned by weibullRMM_SEM, a Stochastic EM algorithm for mixture of Weibull distributions with randomly right censored data (see reference below).

Usage

plotweibullRMM(a, title = NULL, rowstyle = TRUE, subtitle = NULL, ...)

Arguments

a

An object returned by weibullRMM_SEM.

title

The title of the plot, set to some default value if NULL.

rowstyle

Window organization, for plots in rows (the default) or columns.

subtitle

A subtitle for the plot, set to some default value if NULL.

...

Other parameters (such as lwd) passed to plot, lines, and legend commands.

Value

The plot returned

Author(s)

Didier Chauveau

References

See Also

Related functions: weibullRMM_SEM, summary.mixEM.

Other models and algorithms for censored lifetime data (name convention is model_algorithm): expRMM_EM, spRMM_SEM .

Examples

n = 500 # sample size
m = 2 # nb components
lambda=c(0.4, 0.6)
shape <- c(0.5,5); scale <- c(1,20) # model parameters
set.seed(321)
x <- rweibullmix(n, lambda, shape, scale) # iid ~ weibull mixture
cs=runif(n,0,max(x)+10) # iid censoring times
t <- apply(cbind(x,cs),1,min) # censored observations
d <- 1*(x <= cs)              # censoring indicator

## set arbitrary or "reasonable" (e.g., data-driven) initial values
l0 <- rep(1/m,m); sh0 <- c(1, 2); sc0 <- c(2,10)
# Stochastic EM algorithm 
a <- weibullRMM_SEM(t, d, lambda = l0, shape = sh0, scale = sc0, maxit = 200)

summary(a) # Parameters estimates etc
plotweibullRMM(a) # default plot of St-EM sequences

mixtools

Tools for Analyzing Finite Mixture Models

v1.2.0
GPL (>= 2)
Authors
Derek Young [aut, cre] (<https://orcid.org/0000-0002-3048-3803>), Tatiana Benaglia [aut], Didier Chauveau [aut], David Hunter [aut], Ryan Elmore [ctb], Thomas Hettmansperger [ctb], Hoben Thomas [ctb], Fengjuan Xuan [ctb]
Initial release
2020-02-05

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.