DiscreteDistribution {distr}R Documentation

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.

Details

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

Value

Object of class "DiscreteDistribution"

Note

Working with a computer, we use a finite interval as support which carries at least mass 1-getdistrOption("TruncQuantile").

Author(s)

Peter Ruckdeschel Peter.Ruckdeschel@itwm.fraunhofer.de,
Matthias Kohl Matthias.Kohl@stamats.de

See Also

DiscreteDistribution-class AbscontDistribution-class RtoDPQ.d

Examples

# 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)

[Package distr version 2.0.6 Index]