dst_finite: Create a Finite Distribution

View source: R/dst_finite.R

dst_finiteR Documentation

Create a Finite Distribution

Description

A finite distribution assigns probabilities to a finite collection of values. This includes categorical distributions.

Usage

dst_finite(y, probs, data, ...)

Arguments

y

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

probs

<data-masking> Probabilities corresponding to the outcomes in y. Must not be negative, but must sum to 1 (unlike dst_empirical()). Should either evaluate to a vector, or be a name in the specified data.

data

Data frame containing the outcomes y and/or probabilities probs. Optional.

...

Additional arguments, currently not used.

Value

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

Note

This distribution is called "finite" and not "discrete", because a discrete distribution could have an infinite amount of possible outcomes, as in the Poisson distribution.

See Also

dst_empirical()

Examples

dst_finite(1:5, probs = rep(0.2, 5))

vincenzocoia/distionary documentation built on March 5, 2024, 3:13 a.m.