SmoothedDensitiesXY {ScatterDensity}R Documentation

Smoothed Densities X with Y

Description

Density is the smothed histogram density at [X,Y] of [Eilers/Goeman, 2004]

Usage

SmoothedDensitiesXY(X, Y, nbins, lambda, Xkernels, Ykernels, PlotIt = FALSE)

Arguments

X

Numeric vector [1:n], first feature (for x axis values)

Y

Numeric vector [1:n], second feature (for y axis values), nbins= nxy => the nr of bins in x and y is nxy nbins = c(nx,ny) => the nr of bins in x is nx and for y is ny

nbins

number of bins, nbins =200 (default)

lambda

smoothing factor used by the density estimator or c() default: lambda = 20 which roughly means that the smoothing is over 20 bins around a given point.

Xkernels

bin kernels in x direction are given

Ykernels

bin kernels y direction are given

PlotIt

FALSE: no plotting, TRUE: simple plot

Details

lambda has to chosen by the user and is a sensitive parameter.

Value

List of:

Densities

numeric vector [1:n] is the smothed density in 3D

Xkernels

numeric vector [1:nx], nx defined by nbins, such that mesh(Xkernels,Ykernels,F) form the ( not NaN) smothed densisties

Ykernels

numeric vector [1:ny], nx defined by nbins, such that mesh(Xkernels,Ykernels,F) form the ( not NaN) smothed densisties

hist_F_2D

matrix [1:nx,1:ny] beeing the smoothed 2D histogram

ind

an index such that Densities = hist_F_2D[ind]

Author(s)

Michael Thrun

References

[Eilers/Goeman, 2004] Eilers, P. H., & Goeman, J. J.: Enhancing scatterplots with smoothed densities, Bioinformatics, Vol. 20(5), pp. 623-628.DOI: doi:10.1093/bioinformatics/btg454, 2004.

Examples





if(requireNamespace("DataVisualizations")){
data("ITS",package = "DataVisualizations")
data("MTY",package = "DataVisualizations")
Inds=which(ITS<900&MTY<8000)
V=SmoothedDensitiesXY(ITS[Inds],MTY[Inds])
}else{
#sample random data
ITS=rnorm(1000)
MTY=rnorm(1000)
V=SmoothedDensitiesXY(ITS,MTY)
}




[Package ScatterDensity version 0.0.4 Index]