{ } Raw JSON

bundles / scipy latest / scipy / stats / _multivariate / random_table_frozen / pmf

function

scipy.stats._multivariate:random_table_frozen.pmf

source: /scipy/stats/_multivariate.py :6470

Signature

def   pmf ( self x )

Summary

Probability of table to occur in the distribution.

Parameters

x : array-like

Two-dimensional table of non-negative integers, or a multi-dimensional array with the last two dimensions corresponding with the tables.

Returns

pmf : ndarray or scalar

Probability mass function evaluated at x.

Notes

See class definition for a detailed description of parameters.

If row and column marginals of x do not match row and col, zero is returned.

Examples

from scipy.stats import random_table
import numpy as np
x = [[1, 5, 1], [2, 3, 1]]
row = np.sum(x, axis=1)
col = np.sum(x, axis=0)
random_table.pmf(x, row, col)
Alternatively, the object may be called (as a function) to fix the row and column vector sums, returning a "frozen" distribution.
d = random_table(row, col)
d.pmf(x)

Aliases

  • scipy.stats._multivariate.random_table_frozen.pmf