ecdf_bin: Efficient evaluation of the empirical cumulative distribution...

View source: R/RcppExports.R

ecdf_binR Documentation

Efficient evaluation of the empirical cumulative distribution function

Description

Evaluates the empirical cumulative distribution function (ecdf) of a sample data at the evaluation points sorted_x. This is done through binary search.

Usage

ecdf_bin(data, sorted_x, data_sorted = FALSE, efic = TRUE,
  divide_n = TRUE)

Arguments

data

a vector or column matrix containing the sample.

sorted_x

a vector or column matrix with the evaluation points sorted increasingly.

data_sorted

is data is already sorted increasingly? This avoids sorting the data internally.

efic

use the more efficient version of the ecdf evaluation? Set to FALSE only for debugging purposes.

divide_n

if FALSE, returns the absolute frequencies instead of the relative frequencies. Defaults to TRUE.

Value

The ecdf evaluated at sorted_x.

Warning

Be careful on avoiding the next bad usages of the function, which will produce spurious results:

  • sorted_x is not sorted increasingly.

  • data is not sorted increasingly when data_sorted = TRUE-

Author(s)

Original code from Douglas Bates' https://github.com/dmbates/ecdfExample. Minor adaptations by Eduardo García-Portugués.


sphunif documentation built on May 29, 2024, 4:19 a.m.