#NEWLINE# def test_moments( self ) : #NEWLINE# #INDENT# def get_moms( lam , sig , mu ) : #NEWLINE# #INDENT# opK2 = ( 1.0 + ( 1 / ( ( lam * sig ) ** 2 ) ) ) #NEWLINE# exp_skew = ( ( 2 / ( ( lam * sig ) ** 3 ) ) * ( opK2 ** ( - 1.5 ) ) ) #NEWLINE# exp_kurt = ( 6.0 * ( ( 1 + ( ( lam * sig ) ** 2 ) ) ** ( - 2 ) ) ) #NEWLINE# return [ ( mu + ( 1 / lam ) ) , ( ( sig * sig ) + ( 1.0 / ( lam * lam ) ) ) , exp_skew , exp_kurt ] #NEWLINE# #UNINDENT# ( mu , sig , lam ) = ( 0 , 1 , 1 ) #NEWLINE# K = ( 1.0 / ( lam * sig ) ) #NEWLINE# sts = stats . exponnorm . stats ( K , loc = mu , scale = sig , moments = 'mvsk' ) #NEWLINE# assert_almost_equal ( sts , get_moms ( lam , sig , mu ) ) #NEWLINE# ( mu , sig , lam ) = ( ( - 3 ) , 2 , 0.1 ) #NEWLINE# K = ( 1.0 / ( lam * sig ) ) #NEWLINE# sts = stats . exponnorm . stats ( K , loc = mu , scale = sig , moments = 'mvsk' ) #NEWLINE# assert_almost_equal ( sts , get_moms ( lam , sig , mu ) ) #NEWLINE# ( mu , sig , lam ) = ( 0 , 3 , 1 ) #NEWLINE# K = ( 1.0 / ( lam * sig ) ) #NEWLINE# sts = stats . exponnorm . stats ( K , loc = mu , scale = sig , moments = 'mvsk' ) #NEWLINE# assert_almost_equal ( sts , get_moms ( lam , sig , mu ) ) #NEWLINE# ( mu , sig , lam ) = ( ( - 5 ) , 11 , 3.5 ) #NEWLINE# K = ( 1.0 / ( lam * sig ) ) #NEWLINE# sts = stats . exponnorm . stats ( K , loc = mu , scale = sig , moments = 'mvsk' ) #NEWLINE# assert_almost_equal ( sts , get_moms ( lam , sig , mu ) )