hist.BMRMM {BMRMM}R Documentation

Histogram of Duration Times

Description

Plots the histogram of duration times in two ways as the users desire:

  1. Histogram of all duration times superimposed the posterior mean mixture gamma distribution;

  2. Histogram of a specified mixture component superimposed the gamma distribution with shape and rate parameters taken from the last MCMC iteration.

Usage

## S3 method for class 'BMRMM'
hist(
  x,
  comp = NULL,
  xlim = NULL,
  breaks = NULL,
  main = NULL,
  col = "gray",
  xlab = "Duration times",
  ylab = "Density",
  ...
)

Arguments

x

an object of class BMRMM.

comp

one of

  • NULL, which means the histogram for all duration times is plotted with the posterior mean mixture gamma distribution. Default option.

  • an integer specifying the mixture component for which the corresponding histogram is plotted with mixture gamma parameters taken from the last MCMC iteration.

xlim

a range of x values with sensible defaults. Default is NULL, which is to use c(min(duration), max(duration)).

breaks

an integer giving the number of cells for the histogram. Default is NULL, which is to use the Freedman-Diaconis rule, i.e., (max(duration)-min(duration))*n^(1/3)/2/IQR(duration).

main

main title. Default is NULL, which is to use "Histogram with Posterior Mean" when comp is NULL and "Component X" if comp is specified.

col

color of the histogram bars. Default is gray.

xlab

x-axis label. Default is "Duration times".

ylab

y-axis label. Default is "Density".

...

further arguments for the hist function.

Value

An object of class histogram.

Examples

results <- BMRMM(foxp2sm, num.cov = 2, simsize = 50, 
                 duration.distr = list('mixgamma',shape=rep(1,3),rate=rep(1,3)))

# plot the histogram of all duration times superimposed with 
# the posterior mixture gamma distribution
hist(results, xlim = c(0, 1), breaks = 50)

# plot the histogram for components 1 superimposed with 
# the mixture gamma distribution of the last MCMC iteration
hist(results, components = 1)


[Package BMRMM version 1.0.1 Index]