Learn R Programming

distrEx (version 2.9.5)

DiscreteMVDistribution: Generating function for multivariate discrete distribution

Description

Generates an object of class "DiscreteMVDistribution".

Usage

DiscreteMVDistribution(supp, prob, Symmetry = NoSymmetry())

Value

Object of class "DiscreteMVDistribution"

Arguments

supp

numeric matrix whose rows form the support of the discrete multivariate distribution.

prob

vector of probability weights for the elements of supp.

Symmetry

you may help R in calculations if you tell it whether the distribution is non-symmetric (default) or symmetric with respect to a center.

Author

Matthias Kohl Matthias.Kohl@stamats.de

Details

Typical usages are


    DiscreteMVDistribution(supp, prob)
    DiscreteMVDistribution(supp)
  

Identical rows are collapsed to unique support values. If prob is missing, all elements in supp are equally weighted.

See Also

DiscreteMVDistribution-class

Examples

Run this code
# Dirac-measure at (0,0,0)
D1 <- DiscreteMVDistribution(supp = c(0,0,0))
support(D1)

# simple discrete distribution
D2 <- DiscreteMVDistribution(supp = matrix(c(0,1,0,2,2,1,1,0), ncol=2), 
                prob = c(0.3, 0.2, 0.2, 0.3))
support(D2)
r(D2)(10)

Run the code above in your browser using DataLab