Learn R Programming

overlapping (version 1.2)

overlap: Overlapping estimation

Description

It gives the overlapped estimated area of two or more empirical distributions.

Usage

overlap(x, nbins = 1000, plot = FALSE, partial.plot = FALSE)

Arguments

x
list of distributions to be compared; each distribution is an element of the list
nbins
number of equally spaced points at which the overlapping density is evaluated
plot
logical, if TRUE, final plot of estimated densities and overlapped areas is produced
partial.plot
logical, if TRUE, partial paired distributions are plotted

Value

  • It returns a list containing the following components:
  • DDData frame with information used for computing overlapping, containing the following variables: x, coordinates of the points where the density is estimated; y, density; j, index of the distribution in the list x; xclass, class of x; xnum, numerical class of x (obtained by cutnumeric); dominance, indicates which distribution has the highest density; w, flag 0-1 for normalizing area; k, label indicating which distributions are compared
  • OVEstimates of overlapped areas relative to each couple of distributions.

Details

If the list x contains more than two elements (i.e. more than two distributions) it computes all overlapping between all paired distributions. Partial plots refer to these coupled distributions. If plot=TRUE, all overlapped areas are plotted. It requires lattice.

Examples

Run this code
set.seed(20150605)
x <- list(X1=rnorm(100),X2=rt(50,8),X3=rchisq(80,2))
out <- overlap(x,plot=TRUE)

Run the code above in your browser using DataLab