#NEWLINE# def test_Sobol_G_using_sobol( ) : #NEWLINE# #INDENT# '\n    Tests the accuracy of the Sobol/Saltelli procedure using the Sobol_G\n    test function, comparing the results from the Sobol/Saltelli analysis\n    against the analytically computed sensitivity index from the Sobol_G\n    function.\n    ' #NEWLINE# problem = { #NEWLINE# #INDENT# 'num_vars' : 6 , #NEWLINE# 'names' : [ 'x1' , 'x2' , 'x3' , 'x4' , 'x5' , 'x6' ] , #NEWLINE# 'bounds' : [ [ 0 , 1 ] , [ 0 , 1 ] , [ 0 , 1 ] , [ 0 , 1 ] , [ 0 , 1 ] , [ 0 , 1 ] ] , #NEWLINE# #UNINDENT# } #NEWLINE# N = 5000 #NEWLINE# a = np . array ( [ 78 , 12 , 0.5 , 2 , 97 , 33 ] ) #NEWLINE# param_values = saltelli . sample ( problem , Si , calc_second_order = False ) #NEWLINE# model_results = Sobol_G . evaluate ( param_values , a ) #NEWLINE# Si = sobol . analyze ( problem , model_results , calc_second_order = False ) #NEWLINE# expected = Sobol_G . sensitivity_index ( a ) #NEWLINE# assert_allclose ( Si [ 'S1' ] , expected , atol = 0.01 , rtol = 1e-06 )