Learn R Programming

CNPBayes (version 1.2.2)

plot: Plot the densities estimated from a mixture model for a copy number polymorphism

Description

Plot estimates of the posterior density for each component and the overall, marginal density. For batch models, one can additionally plot batch-specific density estimates.

Usage

plot(x, y, ...)
"plot"(x, y, ...)
"plot"(x, y, ...)
"plot"(x, y, show.batch = TRUE, ...)
"plot"(x, show.batch = TRUE, ...)

Arguments

x
a DensityModel-derived object, or a MixtureModel-derived object.
y
If x is a DensityModel, y is a numeric vector of the one-dimensional summaries for a given copy number polymorphism. If x is a MixtureModel, y is ignored.
...
Additional arguments passed to hist.
show.batch
a logical. If true, batch specific densities will be plotted.

Value

A plot showing the density estimate

Examples

Run this code
  set.seed(100)
  truth <- simulateData(N=2500,
                        theta=c(-2, -0.4, 0),
                        sds=c(0.3, 0.15, 0.15),
                        p=c(0.05, 0.1, 0.8))

  mcmcp <- McmcParams(iter=500, burnin=500, thin=2)
  model <- MarginalModel(y(truth), k=3, mcmc.params=mcmcp)
  model <- CNPBayes:::startAtTrueValues(model, truth)
  model <- posteriorSimulation(model)
  par(mfrow=c(1,2), las=1)
  plot(truth)
  plot(model)

Run the code above in your browser using DataLab