inudge.plot.fit: Plot iNUDGE Goodness of Fit

Description Usage Arguments Details See Also Examples

View source: R/inudge.plot.fit.R

Description

Plot the estimated iNUDGE mixture model fitted using inudge.fit along with it's estimated individual components, superimposed on the histogram of the observation data. This plot shows how good the fit of the estimated model to the data.

Usage

1
2
inudge.plot.fit(data, obj, resolution = 100, breaks = 100, 
legpos = NULL, xlim = NULL, main = NULL,...)

Arguments

data

an R list of vector of normalized intensities (counts). Each element can correspond to particular chromosome. User can construct their own list containing only the chromosome(s) they want to analyze.

obj

a list object returned by inudge.fit function.

resolution

optional bandwidth used to estimate the density function. Higher number smoother curve.

breaks

optional see hist, breaks parameters for histogram plot.

legpos

optional vector of (x,y) location for the legend position

xlim

optional x-axis limit (see par).

main

optional plot title (see par).

...

additional graphical arguments to be passed to methods (see par).

Details

The components representing differential data are denoted by asterisk (*) symbol on the plot legend.

See Also

gng.plot.comp, gng.plot.mix, hist

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
library(DIME);
# generate simulated datasets with underlying uniform and 2-normal distributions
set.seed(1234);
N1 <- 1500; N2 <- 500; rmu <- c(-2.25,1.5); rsigma <- c(1,1); 
rpi <- c(.10,.45,.45); a <- (-6); b <- 6; 
chr4 <- list(c(-runif(ceiling(rpi[1]*N1),min = a,max =b),
  rnorm(ceiling(rpi[2]*N1),rmu[1],rsigma[1]), 
  rnorm(ceiling(rpi[3]*N1),rmu[2],rsigma[2])));
chr9 <- list(c(-runif(ceiling(rpi[1]*N2),min = a,max =b),
  rnorm(ceiling(rpi[2]*N2),rmu[1],rsigma[1]), 
  rnorm(ceiling(rpi[3]*N2),rmu[2],rsigma[2])));
# analyzing chromosome 4 and 9
data <- list(chr4,chr9);

# fit iNUDGE model with 2-normal components and maximum iterations = 20
set.seed(1234);
bestInudge <- inudge.fit(data, K = 2, max.iter=20);

# Goodness of fit plot
inudge.plot.fit(data,bestInudge,legpos=c(-6,0.3),ylim=c(0,0.3),breaks=40);

DIME documentation built on May 29, 2017, 6:25 p.m.