'Parameters
n : integer
Number of variates to generate
shape : iterable
Shape of the variates to generate
dim : int
Dimension of the scale matrix
df : int
Degrees of freedom
random_state : np.random.RandomState instance
RandomState used for drawing the random variates.
Notes
As this function does no argument checking, it should not be
called directly; use \'rvs\' instead.'

def _standard_rvs(self, n, shape, dim, df, random_state):

    n_tril = ((dim * (dim - 1)) // 2)
    covariances = random_state.normal(size=(n * n_tril)).reshape((shape + (n_tril,)))
    variances = np.r_[[(random_state.chisquare(((df - (i + 1)) + 1), size=n) ** 0.5) for i in range(dim)]].reshape(((dim,) + shape[::(-1)])).T
    A = np.zeros((shape + (dim, dim)))
    size_idx = tuple(([slice(None, None, None)] * len(shape)))
    tril_idx = np.tril_indices(dim, k=(-1))
    A[(size_idx + tril_idx)] = covariances
    diag_idx = np.diag_indices(dim)
    A[(size_idx + diag_idx)] = variances
    return A
