bin_width_estimator: bin_width_estimator method

View source: R/tools.bin_width_estimator.R

bin_width_estimatorR Documentation

bin_width_estimator method

Description

Lenght of cell to compute an histogram

Usage

bin_width_estimator(X, method = "auto")

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.

Value

[vector] Lenght of bins

Examples

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" ) 


SBCK documentation built on Sept. 11, 2023, 5:10 p.m.