<s> """<STR_LIT>""" <EOL> import numpy as np <EOL> from scipy import stats <EOL> from statsmodels . sandbox . distributions . extras import ( SkewNorm_gen , skewnorm , <EOL> ACSkewT_gen , <EOL> NormExpan_gen , pdf_moments , <EOL> ExpTransf_gen , LogTransf_gen ) <EOL> from statsmodels . stats . moment_helpers import mc2mvsk , mnc2mc , mvsk2mnc <EOL> def example_n ( ) : <EOL> print ( skewnorm . pdf ( <NUM_LIT:1> , <NUM_LIT:0> ) , stats . norm . pdf ( <NUM_LIT:1> ) , skewnorm . pdf ( <NUM_LIT:1> , <NUM_LIT:0> ) - stats . norm . pdf ( <NUM_LIT:1> ) ) <EOL> print ( skewnorm . pdf ( <NUM_LIT:1> , <NUM_LIT:1000> ) , stats . chi . pdf ( <NUM_LIT:1> , <NUM_LIT:1> ) , skewnorm . pdf ( <NUM_LIT:1> , <NUM_LIT:1000> ) - stats . chi . pdf ( <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> print ( skewnorm . pdf ( - <NUM_LIT:1> , - <NUM_LIT:1000> ) , stats . chi . pdf ( <NUM_LIT:1> , <NUM_LIT:1> ) , skewnorm . pdf ( - <NUM_LIT:1> , - <NUM_LIT:1000> ) - stats . chi . pdf ( <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> rvs = skewnorm . rvs ( <NUM_LIT:0> , size = <NUM_LIT> ) <EOL> print ( '<STR_LIT>' , rvs . mean ( ) , rvs . var ( ) ) <EOL> print ( '<STR_LIT>' , skewnorm . stats ( <NUM_LIT:0> ) ) <EOL> rvs = skewnorm . rvs ( <NUM_LIT:5> , size = <NUM_LIT> ) <EOL> print ( '<STR_LIT>' , rvs . mean ( ) , rvs . var ( ) ) <EOL> print ( '<STR_LIT>' , skewnorm . stats ( <NUM_LIT:5> ) ) <EOL> print ( skewnorm . cdf ( <NUM_LIT:1> , <NUM_LIT:0> ) , stats . norm . cdf ( <NUM_LIT:1> ) , skewnorm . cdf ( <NUM_LIT:1> , <NUM_LIT:0> ) - stats . norm . cdf ( <NUM_LIT:1> ) ) <EOL> print ( skewnorm . cdf ( <NUM_LIT:1> , <NUM_LIT:1000> ) , stats . chi . cdf ( <NUM_LIT:1> , <NUM_LIT:1> ) , skewnorm . cdf ( <NUM_LIT:1> , <NUM_LIT:1000> ) - stats . chi . cdf ( <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> print ( skewnorm . sf ( <NUM_LIT> , <NUM_LIT:1000> ) , stats . chi . sf ( <NUM_LIT> , <NUM_LIT:1> ) , skewnorm . sf ( <NUM_LIT> , <NUM_LIT:1000> ) - stats . chi . sf ( <NUM_LIT> , <NUM_LIT:1> ) ) <EOL> def example_T ( ) : <EOL> skewt = ACSkewT_gen ( ) <EOL> rvs = skewt . rvs ( <NUM_LIT:10> , <NUM_LIT:0> , size = <NUM_LIT> ) <EOL> print ( '<STR_LIT>' , rvs . mean ( ) , rvs . var ( ) ) <EOL> print ( '<STR_LIT>' , skewt . stats ( <NUM_LIT:10> , <NUM_LIT:0> ) ) <EOL> print ( '<STR_LIT>' , stats . t . stats ( <NUM_LIT:10> ) ) <EOL> print ( skewt . stats ( <NUM_LIT:10> , <NUM_LIT:1000> ) ) <EOL> rvs = np . abs ( stats . t . rvs ( <NUM_LIT:10> , size = <NUM_LIT:1000> ) ) <EOL> print ( rvs . mean ( ) , rvs . var ( ) ) <EOL> def examples_normexpand ( ) : <EOL> skewnorm = SkewNorm_gen ( ) <EOL> rvs = skewnorm . rvs ( <NUM_LIT:5> , size = <NUM_LIT:100> ) <EOL> normexpan = NormExpan_gen ( rvs , mode = '<STR_LIT>' ) <EOL> smvsk = stats . describe ( rvs ) [ <NUM_LIT:2> : ] <EOL> print ( '<STR_LIT>' ) <EOL> print ( smvsk ) <EOL> dmvsk = normexpan . stats ( moments = '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( dmvsk ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( np . array ( dmvsk ) - np . array ( smvsk ) ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( mc2mvsk ( normexpan . cnt ) ) <EOL> print ( normexpan . mvsk ) <EOL> mnc = mvsk2mnc ( dmvsk ) <EOL> mc = mnc2mc ( mnc ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( mc ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( mnc ) <EOL> pdffn = pdf_moments ( mc ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' , mc [ <NUM_LIT:0> ] - <NUM_LIT:1> , mc [ <NUM_LIT:0> ] + <NUM_LIT:1> ) <EOL> print ( pdffn ( [ mc [ <NUM_LIT:0> ] - <NUM_LIT:1> , mc [ <NUM_LIT:0> ] + <NUM_LIT:1> ] ) ) <EOL> print ( normexpan . pdf ( [ mc [ <NUM_LIT:0> ] - <NUM_LIT:1> , mc [ <NUM_LIT:0> ] + <NUM_LIT:1> ] ) ) <EOL> def examples_transf ( ) : <EOL> print ( '<STR_LIT>' ) <EOL> lognormalg = ExpTransf_gen ( stats . norm , a = <NUM_LIT:0> , name = '<STR_LIT>' ) <EOL> print ( lognormalg . cdf ( <NUM_LIT:1> ) ) <EOL> print ( stats . lognorm . cdf ( <NUM_LIT:1> , <NUM_LIT:1> ) ) <EOL> print ( lognormalg . stats ( ) ) <EOL> print ( stats . lognorm . stats ( <NUM_LIT:1> ) ) <EOL> print ( lognormalg . rvs ( size = <NUM_LIT:5> ) ) <EOL> print ( '<STR_LIT>' ) <EOL> loggammaexpg = LogTransf_gen ( stats . gamma ) <EOL> print ( loggammaexpg . _cdf ( <NUM_LIT:1> , <NUM_LIT:10> ) ) <EOL> print ( stats . loggamma . cdf ( <NUM_LIT:1> , <NUM_LIT:10> ) ) <EOL> print ( loggammaexpg . _cdf ( <NUM_LIT:2> , <NUM_LIT:15> ) ) <EOL> print ( stats . loggamma . cdf ( <NUM_LIT:2> , <NUM_LIT:15> ) ) <EOL> print ( '<STR_LIT>' ) <EOL> loglaplaceg = LogTransf_gen ( stats . laplace ) <EOL> print ( loglaplaceg . _cdf ( <NUM_LIT:2> ) ) <EOL> print ( stats . loglaplace . cdf ( <NUM_LIT:2> , <NUM_LIT:1> ) ) <EOL> loglaplaceexpg = ExpTransf_gen ( stats . laplace ) <EOL> print ( loglaplaceexpg . _cdf ( <NUM_LIT:2> ) ) <EOL> stats . loglaplace . cdf ( <NUM_LIT:3> , <NUM_LIT:3> ) <EOL> loglaplaceexpg . _cdf ( <NUM_LIT:3> , <NUM_LIT:0> , <NUM_LIT:1.> / <NUM_LIT:3> ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> example_n ( ) <EOL> example_T ( ) <EOL> examples_normexpand ( ) <EOL> examples_transf ( ) </s>
