marginal: Marginal distribution of a joint random variable

Description Usage Arguments Author(s) Examples

Description

Extracts the marginal probability mass functions from a joint distribution.

Usage

1
marginal(X, num)

Arguments

X

A random variable

num

Number indicating which marginal distribution to extract

Author(s)

Eric Hare erichare@iastate.edu

Examples

1
2
3
AandB <- jointRV(outcomes = list(1:3, 0:2), probs = 1:9 / sum(1:9))
marginal(AandB, 1)
marginal(AandB, 2)

Example output

Attaching package: 'discreteRV'

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

    %in%

Random variable with 3 outcomes

Outcomes    1    2    3
Probs    2/15  1/3 8/15
Random variable with 3 outcomes

sh: 1: rm: Permission denied
Outcomes    0    1    2
Probs    4/15  1/3  2/5

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