margins: Marginal distributions of a joint random variable

Description Usage Arguments Author(s) Examples

Description

Extracts the marginal probability mass functions from a joint distribution.

Usage

1
margins(X, sep = ",")

Arguments

X

a random variable

sep

parameter specifying the separator between dimensions, defaults to ","

Author(s)

Heike Hofmann hofmann@iastate.edu

Examples

1
2
3
X <- RV(1:6, 1/6)
X3 <- iid(X, 3)
margins(X3)

Example output

Attaching package: 'discreteRV'

The following object is masked from 'package:base':

    %in%

[[1]]
Random variable with 6 outcomes

Outcomes   1   2   3   4   5   6
Probs    1/6 1/6 1/6 1/6 1/6 1/6

[[2]]
Random variable with 6 outcomes

Outcomes   1   2   3   4   5   6
Probs    1/6 1/6 1/6 1/6 1/6 1/6

[[3]]
Random variable with 6 outcomes

Outcomes   1   2   3   4   5   6
Probs    1/6 1/6 1/6 1/6 1/6 1/6

discreteRV documentation built on May 2, 2019, 11:04 a.m.