예제 #1
0
def test_loggamma():
    #'Results for expgamma'
    loggammaexpg = LogTransf_gen(stats.gamma)
    cdftr = loggammaexpg._cdf(1,10)
    cdfst = stats.loggamma.cdf(1,10)
    assert_almost_equal(cdfst, cdftr, 14)

    cdftr = loggammaexpg._cdf(2,15)
    cdfst = stats.loggamma.cdf(2,15)
    assert_almost_equal(cdfst, cdftr, 14)
예제 #2
0
def test_loggamma():
    #'Results for expgamma'
    loggammaexpg = LogTransf_gen(stats.gamma)
    cdftr = loggammaexpg._cdf(1, 10)
    cdfst = stats.loggamma.cdf(1, 10)
    assert_almost_equal(cdfst, cdftr, 14)

    cdftr = loggammaexpg._cdf(2, 15)
    cdfst = stats.loggamma.cdf(2, 15)
    assert_almost_equal(cdfst, cdftr, 14)
예제 #3
0
 def __init__(self):
     self.dist = LogTransf_gen(stats.gamma)
     self.trargs = (10, )
     self.trkwds = {}
     self.statsdist = stats.loggamma
     self.stargs = (10, )
     self.stkwds = {}
예제 #4
0
def examples_transf():
    ##lognormal = ExpTransf(a=0.0, xa=-10.0, name = 'Log transformed normal')
    ##print lognormal.cdf(1)
    ##print stats.lognorm.cdf(1,1)
    ##print lognormal.stats()
    ##print stats.lognorm.stats(1)
    ##print lognormal.rvs(size=10)

    print 'Results for lognormal'
    lognormalg = ExpTransf_gen(stats.norm, a=0, name = 'Log transformed normal general')
    print lognormalg.cdf(1)
    print stats.lognorm.cdf(1,1)
    print lognormalg.stats()
    print stats.lognorm.stats(1)
    print lognormalg.rvs(size=5)

    ##print 'Results for loggamma'
    ##loggammag = ExpTransf_gen(stats.gamma)
    ##print loggammag._cdf(1,10)
    ##print stats.loggamma.cdf(1,10)

    print 'Results for expgamma'
    loggammaexpg = LogTransf_gen(stats.gamma)
    print loggammaexpg._cdf(1,10)
    print stats.loggamma.cdf(1,10)
    print loggammaexpg._cdf(2,15)
    print stats.loggamma.cdf(2,15)


    # this requires change in scipy.stats.distribution
    #print loggammaexpg.cdf(1,10)

    print 'Results for loglaplace'
    loglaplaceg = LogTransf_gen(stats.laplace)
    print loglaplaceg._cdf(2)
    print stats.loglaplace.cdf(2,1)
    loglaplaceexpg = ExpTransf_gen(stats.laplace)
    print loglaplaceexpg._cdf(2)
    stats.loglaplace.cdf(3,3)
    #0.98148148148148151
    loglaplaceexpg._cdf(3,0,1./3)
예제 #5
0
def examples_transf():
    ##lognormal = ExpTransf(a=0.0, xa=-10.0, name = 'Log transformed normal')
    ##print(lognormal.cdf(1))
    ##print(stats.lognorm.cdf(1,1))
    ##print(lognormal.stats())
    ##print(stats.lognorm.stats(1))
    ##print(lognormal.rvs(size=10))

    print('Results for lognormal')
    lognormalg = ExpTransf_gen(stats.norm, a=0, name = 'Log transformed normal general')
    print(lognormalg.cdf(1))
    print(stats.lognorm.cdf(1,1))
    print(lognormalg.stats())
    print(stats.lognorm.stats(1))
    print(lognormalg.rvs(size=5))

    ##print('Results for loggamma')
    ##loggammag = ExpTransf_gen(stats.gamma)
    ##print(loggammag._cdf(1,10))
    ##print(stats.loggamma.cdf(1,10))

    print('Results for expgamma')
    loggammaexpg = LogTransf_gen(stats.gamma)
    print(loggammaexpg._cdf(1,10))
    print(stats.loggamma.cdf(1,10))
    print(loggammaexpg._cdf(2,15))
    print(stats.loggamma.cdf(2,15))


    # this requires change in scipy.stats.distribution
    #print(loggammaexpg.cdf(1,10))

    print('Results for loglaplace')
    loglaplaceg = LogTransf_gen(stats.laplace)
    print(loglaplaceg._cdf(2))
    print(stats.loglaplace.cdf(2,1))
    loglaplaceexpg = ExpTransf_gen(stats.laplace)
    print(loglaplaceexpg._cdf(2))
    stats.loglaplace.cdf(3,3)
    #0.98148148148148151
    loglaplaceexpg._cdf(3,0,1./3)