def test_randimoize_corrmat_tails():
 a = rs.randn(30)
 b = (a + (rs.rand(30) * 8))
 c = rs.randn(30)
 d = [a, b, c]
 p_mat_b = algo.randomize_corrmat(d, 'both', False, random_seed=0)
 p_mat_u = algo.randomize_corrmat(d, 'upper', False, random_seed=0)
 p_mat_l = algo.randomize_corrmat(d, 'lower', False, random_seed=0)
 assert_equal(p_mat_b[(0, 1)], (p_mat_u[(0, 1)] * 2))
 assert_equal(p_mat_l[(0, 1)], (1 - p_mat_u[(0, 1)]))

def test_randimoize_corrmat_tails ( ) : a = rs . randn ( 30 ) b = ( a + ( rs . rand ( 30 ) * 8 ) ) c = rs . randn ( 30 ) d = [ a , b , c ] p_mat_b = algo . randomize_corrmat ( d , 'both' , False , random_seed = 0 ) p_mat_u = algo . randomize_corrmat ( d , 'upper' , False , random_seed = 0 ) p_mat_l = algo . randomize_corrmat ( d , 'lower' , False , random_seed = 0 ) assert_equal ( p_mat_b [ ( 0 , 1 ) ] , ( p_mat_u [ ( 0 , 1 ) ] * 2 ) ) assert_equal ( p_mat_l [ ( 0 , 1 ) ] , ( 1 - p_mat_u [ ( 0 , 1 ) ] ) )
test that the tail argument works .