SciPy

prob140.JointDistribution.both_marginals

JointDistribution.both_marginals()[source]

Finds the marginal distribution of both variables.

Returns:
JointDistribution Table.

Examples

>>> dist1 = Table().values([0, 1], [2, 3]).probability([0.1, 0.2, 0.3, 0.4]).to_joint()
>>> dist1.both_marginals()
                    X=0  X=1  Sum: Marginal of Y
Y=3                 0.2  0.4                 0.6
Y=2                 0.1  0.3                 0.4
Sum: Marginal of X  0.3  0.7                 1.0