#NEWLINE# def test_corr_psd( ) : #NEWLINE# #INDENT# x = np . array ( [ [ 1 , ( - 0.2 ) , ( - 0.9 ) ] , [ ( - 0.2 ) , 1 , ( - 0.2 ) ] , [ ( - 0.9 ) , ( - 0.2 ) , 1 ] ] ) #NEWLINE# y = corr_nearest ( x , n_fact = 100 ) #NEWLINE# assert_almost_equal ( x , y , decimal = 14 ) #NEWLINE# y = corr_clipped ( x ) #NEWLINE# assert_almost_equal ( x , y , decimal = 14 ) #NEWLINE# y = cov_nearest ( x , n_fact = 100 ) #NEWLINE# assert_almost_equal ( x , y , decimal = 14 ) #NEWLINE# x2 = ( x + ( 0.001 * np . eye ( 3 ) ) ) #NEWLINE# y = cov_nearest ( x2 , n_fact = 100 ) #NEWLINE# assert_almost_equal ( x2 , y , decimal = 14 )