def multivariate_t_rvs(m, S, df=np.inf, n=1):
 m = np.asarray(m)
 d = len(m)
 if (df == np.inf):
  x = 1.0
 else:
  x = (np.random.chisquare(df, n) / df)
 z = np.random.multivariate_normal(np.zeros(d), S, (n,))
 return (m + (z / np.sqrt(x)[:, None]))

def multivariate_t_rvs ( m , S , df = np . inf , n = 1 ) : m = np . asarray ( m ) d = len ( m ) if ( df == np . inf ) : x = 1.0 else : x = ( np . random . chisquare ( df , n ) / df ) z = np . random . multivariate_normal ( np . zeros ( d ) , S , ( n , ) ) return ( m + ( z / np . sqrt ( x ) [ : , None ] ) )
generate random variables of multivariate t distribution parameters m : array_like mean of random variable .