Learn R Programming

SBCK (version 1.0.0)

bin_width_estimator: bin_width_estimator method

Description

Lenght of cell to compute an histogram

Usage

bin_width_estimator(X, method = "auto")

Value

[vector] Lenght of bins

Arguments

X

[matrix] A matrix containing data, nrow = n_samples, ncol = n_features

method

[string] Method to estimate bin_width, values are "auto", "FD" (Friedman Draconis, robust over outliners) or "Sturges". If "auto" is used and if nrow(X) < 1000, "Sturges" is used, else "FD" is used.

Examples

Run this code
X = base::cbind( stats::rnorm( n = 2000 ) , stats::rexp(2000) )
## Friedman Draconis is used
binw_width = SBCK::bin_width_estimator( X , method = "auto" ) 
X = stats::rnorm( n = 500 )
## Sturges is used
binw_width = SBCK::bin_width_estimator( X , method = "auto" ) 

Run the code above in your browser using DataLab