def test_randomize_corrmat_dist():
 a = rs.randn(3, 20)
 for n_i in [5, 10]:
  (p_mat, dist) = algo.randomize_corrmat(a, n_iter=n_i, return_dist=True)
  assert_equal(n_i, dist.shape[(-1)])
 (p_mat, dist) = algo.randomize_corrmat(a, n_iter=10000, return_dist=True)
 diag_mean = dist[(0, 0)].mean()
 assert_equal(diag_mean, 1)
 off_diag_mean = dist[(0, 1)].mean()
 nose.tools.assert_greater(0.05, off_diag_mean)

def test_randomize_corrmat_dist ( ) : a = rs . randn ( 3 , 20 ) for n_i in [ 5 , 10 ] : ( p_mat , dist ) = algo . randomize_corrmat ( a , n_iter = n_i , return_dist = True ) assert_equal ( n_i , dist . shape [ ( - 1 ) ] ) ( p_mat , dist ) = algo . randomize_corrmat ( a , n_iter = 10000 , return_dist = True ) diag_mean = dist [ ( 0 , 0 ) ] . mean ( ) assert_equal ( diag_mean , 1 ) off_diag_mean = dist [ ( 0 , 1 ) ] . mean ( ) nose . tools . assert_greater ( 0.05 , off_diag_mean )
test that the distribution looks right .