#NEWLINE# def test_stats( self ) : #NEWLINE# #INDENT# with warnings . catch_warnings ( ) : #NEWLINE# #INDENT# warnings . simplefilter ( 'error' , RuntimeWarning ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 0.5 , moments = 'mvsk' ) #NEWLINE# assert_equal ( m , np . inf ) #NEWLINE# assert_equal ( v , np . inf ) #NEWLINE# assert_equal ( s , np . nan ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 1.0 , moments = 'mvsk' ) #NEWLINE# assert_equal ( m , np . inf ) #NEWLINE# assert_equal ( v , np . inf ) #NEWLINE# assert_equal ( s , np . nan ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 1.5 , moments = 'mvsk' ) #NEWLINE# assert_equal ( m , 3.0 ) #NEWLINE# assert_equal ( v , np . inf ) #NEWLINE# assert_equal ( s , np . nan ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 2.0 , moments = 'mvsk' ) #NEWLINE# assert_equal ( m , 2.0 ) #NEWLINE# assert_equal ( v , np . inf ) #NEWLINE# assert_equal ( s , np . nan ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 2.5 , moments = 'mvsk' ) #NEWLINE# assert_allclose ( m , ( 2.5 / 1.5 ) ) #NEWLINE# assert_allclose ( v , ( 2.5 / ( ( 1.5 * 1.5 ) * 0.5 ) ) ) #NEWLINE# assert_equal ( s , np . nan ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 3.0 , moments = 'mvsk' ) #NEWLINE# assert_allclose ( m , 1.5 ) #NEWLINE# assert_allclose ( v , 0.75 ) #NEWLINE# assert_equal ( s , np . nan ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 3.5 , moments = 'mvsk' ) #NEWLINE# assert_allclose ( m , ( 3.5 / 2.5 ) ) #NEWLINE# assert_allclose ( v , ( 3.5 / ( ( 2.5 * 2.5 ) * 1.5 ) ) ) #NEWLINE# assert_allclose ( s , ( ( ( 2 * 4.5 ) / 0.5 ) * np . sqrt ( ( 1.5 / 3.5 ) ) ) ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 4.0 , moments = 'mvsk' ) #NEWLINE# assert_allclose ( m , ( 4.0 / 3.0 ) ) #NEWLINE# assert_allclose ( v , ( 4.0 / 18.0 ) ) #NEWLINE# assert_allclose ( s , ( ( ( 2 * ( 1 + 4.0 ) ) / ( 4.0 - 3 ) ) * np . sqrt ( ( ( 4.0 - 2 ) / 4.0 ) ) ) ) #NEWLINE# assert_equal ( k , np . nan ) #NEWLINE# ( m , v , s , k ) = stats . pareto . stats ( 4.5 , moments = 'mvsk' ) #NEWLINE# assert_allclose ( m , ( 4.5 / 3.5 ) ) #NEWLINE# assert_allclose ( v , ( 4.5 / ( ( 3.5 * 3.5 ) * 2.5 ) ) ) #NEWLINE# assert_allclose ( s , ( ( ( 2 * 5.5 ) / 1.5 ) * np . sqrt ( ( 2.5 / 4.5 ) ) ) ) #NEWLINE# assert_allclose ( k , ( ( 6 * ( ( ( ( 4.5 ** 3 ) + ( 4.5 ** 2 ) ) - ( 6 * 4.5 ) ) - 2 ) ) / ( ( 4.5 * 1.5 ) * 0.5 ) ) )