estimate_cdf {DMTL} | R Documentation |
Estimate Cumulative Distribution
Description
This function estimates the values of the cumulative distribution function (CDF) for a vector.
Usage
estimate_cdf(
x,
bootstrap = TRUE,
samples = 1e+06,
density = FALSE,
binned = TRUE,
grids = 10000,
unit_range = FALSE,
seed = NULL,
...
)
Arguments
x |
Vector containing data. |
bootstrap |
Flag for performing bootstrapping on |
samples |
Sample size for bootstrapping. Defaults to |
density |
Flag for calculating kernel density estimates (KDE) instead
of histogram counts. Depends on the |
binned |
Flag for calculating binned KDE. Defaults to |
grids |
Size parameter for the estimation grid when |
unit_range |
Flag for unity data range (i.e., data is normalized
between 0 and 1). Defaults to |
seed |
Seed for random number generator (for reproducible outcomes).
Defaults to |
... |
Other options relevant for distribution estimation. |
Value
If density = FALSE
, a function of class ecdf
, inheriting from the
stepfun
class, and hence inheriting a knots()
method.
If density = TRUE
, an object of class kcde
which has the fields
eval.points
and estimate
necessary for calculating a map.
Examples
x <- runif(100)
x_hist_cdf <- estimate_cdf(x, samples = 1000, unit_range = TRUE)
x_kde_cdf <- estimate_cdf(x, density = TRUE, unit_range = TRUE)