dst_empirical: Create an Empirical Distribution

Description Usage Arguments Value See Also Examples

View source: R/dst_empirical.R

Description

An empirical distribution is a non-parametric way to estimate a distribution using data. By default, it assigns equal probability to all observations (this can be overridden with the weights argument). Identical to dst_finite() with weights as probabilities, except weights need not add to 1.

Usage

1

Arguments

y

<data-masking> Outcomes to comprise the distribution. Should either evaluate to an (atomic) vector, or be a name in the specified data.

data

Data frame containing the outcomes y and/or weights. Optional.

weights

<data-masking> Weights to assign each outcome in y. Will be normalized so that the weights add up to 1 (unlike dst_finite()), representing probabilities.

...

Additional arguments, currently not used.

Value

An object of class c("finite", "dst").

See Also

dst_finite()

Examples

1
2
3
x <- rnorm(100)
dst_empirical(x)
dst_empirical(value, data = data.frame(value = x))

vincenzocoia/distionary documentation built on Jan. 18, 2022, 11:07 p.m.