SmoothedDensitiesXY | R Documentation |
Density is the smothed histogram density at [X,Y] of [Eilers/Goeman, 2004]
SmoothedDensitiesXY(X, Y, nbins, lambda, Xkernels, Ykernels,
Compute="Cpp", PlotIt = FALSE)
X |
Numeric vector [1:n], first feature (for x axis values) |
Y |
Numeric vector [1:n], second feature (for y axis values), |
nbins |
Optional, number of bins, default is 250, if scalar nbins=nx=ny otherwise c(nx,ny) vector of length 2 |
lambda |
Optional, smoothing factor used by the density estimator, default is lambda = 20 |
Xkernels |
Optional, bin kernels in x direction are given, if not set nx bins in range of data are generated with |
Ykernels |
Optional, bin kernels y direction are given, if not set ny bins in range of data are generated with |
Compute |
Either |
PlotIt |
FALSE: no plotting, TRUE: simple plot |
lambda
has to chosen by the user and is a sensitive parameter and a lambda = 20
roughly means that the smoothing is over 20 bins around a given point.
List of:
Densities |
numeric vector [1:n] is the smothed density in 3D |
Xkernels |
numeric vector [1:nx], nx defined by |
Ykernels |
numeric vector [1:ny], nx defined by |
GridDensity |
matrix [1:nx,1:ny] beeing the smoothed 2D histogram |
Points2GridInd |
an index such that |
Michael Thrun
[Eilers/Goeman, 2004] Eilers, P. H., & Goeman, J. J.: Enhancing scatterplots with smoothed densities, Bioinformatics, Vol. 20(5), pp. 623-628.DOI: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/bioinformatics/btg454")}, 2004.
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.