{ } Raw JSON

bundles / scipy latest / scipy / stats / _multivariate / random_table_frozen / rvs

function

scipy.stats._multivariate:random_table_frozen.rvs

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

Signature

def   rvs ( self size = None method = None random_state = None )

Summary

Draw random tables with fixed column and row marginals.

Parameters

size : integer, optional

Number of samples to draw (default 1).

method : str, optional

Which method to use, "boyett" or "patefield". If None (default), selects the fastest method for this input.

seed : {None, int, np.random.RandomState, np.random.Generator}, optional

Used for drawing random variates. If seed is None, the ~np.random.RandomState singleton is used. If seed is an int, a new RandomState instance is used, seeded with seed. If seed is already a RandomState or Generator instance, then that object is used. Default is None.

Returns

rvs : ndarray

Random 2D tables of shape (size, len(row), len(col)).

Notes

See class definition for a detailed description of parameters.

Examples

from scipy.stats import random_table
row = [1, 5]
col = [2, 3, 1]
random_table.rvs(row, col, random_state=123)
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.rvs(random_state=123)

Aliases

  • scipy.stats._multivariate.random_table_frozen.rvs