nudge.plot.mix | R Documentation |
Plot each estimated individual components of NUDGE mixture model fitted using
nudge.fit
.
nudge.plot.mix(obj, amplify = 1, resolution = 100, new.plot = TRUE, ...)
obj |
a list object returned by |
amplify |
optional scaling factor for visualization purposes. |
resolution |
optional bandwidth used to estimate the density function. Higher number makes a smoother curve. |
new.plot |
optional logical variable on whether to create new plot. |
... |
additional graphical arguments to be passed to methods (see |
nudge.plot.comp
, nudge.plot.fit
,
nudge.plot.qq
, DIME.plot.fit
, gng.plot.fit
.
library(DIME); # generate simulated datasets with underlying uniform and 1-normal components set.seed(1234); N1 <- 1500; N2 <- 500; rmu <- c(1.5); rsigma <- c(1); rpi <- c(.10,.90); a <- (-6); b <- 6; chr1 <- c(-runif(ceiling(rpi[1]*N1),min = a,max =b), rnorm(ceiling(rpi[2]*N1),rmu[1],rsigma[1])); chr4 <- c(-runif(ceiling(rpi[1]*N2),min = a,max =b), rnorm(ceiling(rpi[2]*N2),rmu[1],rsigma[1])); # analyzing chromosome 1 and 4 data <- list(chr1,chr4); # fit NUDGE model with maximum iterations = 20 only bestNudge <- nudge.fit(data, max.iter=20); # plot estimated iNUDGE model imposed on the histogram of observed data hist(unlist(data),freq=FALSE,breaks=40); nudge.plot.mix(bestNudge,resolution=1000,new.plot=FALSE,col="red");
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.