plotly_expRMM: Plot sequences from the EM algorithm for censored mixture of...

View source: R/plotly_expRMM.R

plotly_expRMMR Documentation

Plot sequences from the EM algorithm for censored mixture of exponentials using plotly

Description

This is an updated function of plotexpRMM. For more technical details, please refer to plotexpRMM.

Usage

  plotly_expRMM(a , title = NULL , rowstyle = TRUE , subtitle=NULL,
  width = 2 , cex = 2 , col.comp = NULL,
  legend.text = NULL, legend.text.size = 15, legend.size = 15,
  title.x = 0.5, title.y = 0.95, title.size = 15,
  xlab.size = 15, xtick.size = 15, 
  ylab.size = 15, ytick.size = 15)

Arguments

a

An object returned by expRMM_EM.

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.

width

Line width.

cex

Size of dots.

col.comp

Color of different components. Number of color specified needs to be consistent with number of components.

legend.text

Title of legend.

legend.text.size

Size of the legend title.

legend.size

Size of legend.

title.size

Size of the main title.

title.x

Horsizontal position of the main title.

title.y

Vertical posotion of the main title.

xlab.size

Size of the lable of X-axis.

xtick.size

Size of tick lables of X-axis.

ylab.size

Size of the lable of Y-axis.

ytick.size

Size of tick lables of Y-axis.

Value

The plot returned

Author(s)

Didier Chauveau

References

See Also

Related functions: expRMM_EM, summary.mixEM, plot.mixEM, plotexpRMM.

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

Examples

n=300 # sample size
m=2 # number of mixture components
lambda <- c(1/3,1-1/3); rate <- c(1,1/10) # mixture parameters
set.seed(1234)
x <- rexpmix(n, lambda, rate) # iid ~ exponential mixture
cs=runif(n,0,max(x)) # Censoring (uniform) and incomplete data
t <- apply(cbind(x,cs),1,min) # observed or censored data
d <- 1*(x <= cs) # censoring indicator
###### EM for RMM, exponential lifetimes
l0 <- rep(1/m,m); r0 <- c(1, 0.5) # "arbitrary" initial values
a <- expRMM_EM(t, d, lambda=l0, rate=r0, k = m)
summary(a) # EM estimates etc
plotly_expRMM(a , rowstyle = TRUE) # plot of EM sequences



mixtools documentation built on Dec. 5, 2022, 5:23 p.m.