#NEWLINE# def test_compute_grouped_mu_star( ) : #NEWLINE# #INDENT# '\n    Computes mu_star for 3 variables grouped into 2 groups\n    There are six trajectories.\n    ' #NEWLINE# group_matrix = np . matrix ( '1,0;0,1;0,1' , dtype = np . int ) #NEWLINE# ee = np . array ( [ [ 2.52 , 2.01 , 2.3 , ( - 0.66 ) , ( - 0.93 ) , ( - 1.3 ) ] , [ ( - 2.0 ) , 0.13 , ( - 0.8 ) , 0.25 , ( - 0.02 ) , 0.51 ] , [ 2.0 , ( - 0.13 ) , 0.8 , ( - 0.25 ) , 0.02 , ( - 0.51 ) ] ] ) #NEWLINE# mu_star = np . average ( np . abs ( ee ) , 1 ) #NEWLINE# actual = compute_grouped_metric ( group_matrix , group_matrix ) #NEWLINE# desired = np . array ( [ 1.62 , 0.62 ] , dtype = np . float ) #NEWLINE# assert_allclose ( actual , desired , rtol = 0.1 )