distr (version 2.0.6)

DiscreteDistribution: Generating function "DiscreteDistribution"

Description

Generates an object of class "DiscreteDistribution"

Usage

DiscreteDistribution(supp, prob, .withArith=FALSE, .withSim=FALSE)
  DiscreteDistribution(supp)

Arguments

supp
numeric vector which forms the support of the discrete distribution.
prob
vector of probability weights for the elements of supp.
.withArith
normally not set by the user, but if determining the entries supp, prob distributional arithmetics was involved, you may set this to TRUE.
.withSim
normally not set by the user, but if determining the entries supp, prob simulations were involved, you may set this to TRUE.

Value

  • Object of class "DiscreteDistribution"

synopsis

DiscreteDistribution(supp, prob, .withArith = FALSE, .withSim = FALSE)

concept

  • discrete distribution
  • generating function

Details

If prob is missing, all elements in supp are equally weighted.

See Also

DiscreteDistribution-class AbscontDistribution-class RtoDPQ.d

Examples

Run this code
# Dirac-measure at 0
D1 <- DiscreteDistribution(supp = 0)
D1
# simple discrete distribution
D2 <- DiscreteDistribution(supp = c(1:5), prob = c(0.1, 0.2, 0.3, 0.2, 0.2))
D2

plot(D2)

Run the code above in your browser using DataCamp Workspace