hist_out {bigutilsr} | R Documentation |
Outlier detection based on departure from histogram. Suitable for compact values (need a space between main values and outliers).
hist_out(x, breaks = nclass.scottRob, pmax_out = 0.2, nboot = NULL)
x |
Numeric vector (with compact values). |
breaks |
Same parameter as for |
pmax_out |
Percentage at each side that can be considered outliers at
each step. Default is |
nboot |
Number of bootstrap replicates to estimate limits more robustly.
Default is |
A list with
x
: the initial vector, whose outliers have been removed,
lim
: lower and upper limits for outlier removal,
all_lim
: all bootstrap replicates for lim
(if nboot
not NULL
).
set.seed(1) x <- rnorm(1000) str(hist_out(x)) # Easy to separate x2 <- c(x, rnorm(50, mean = 7)) hist(x2, breaks = nclass.scottRob) str(hist_out(x2)) # More difficult to separate x3 <- c(x, rnorm(50, mean = 6)) hist(x3, breaks = nclass.scottRob) str(hist_out(x3)) str(hist_out(x3, nboot = 999))