Removed reference to ppimport

master
Per.Andreas.Brodtkorb 15 years ago
parent 4e40a3e5a9
commit 3623d76102

@ -865,51 +865,52 @@ class FitDistribution(rv_frozen):
def main(): def main():
_WAFODIST = ppimport('wafo.stats.distributions') pass
#nbinom(10, 0.75).rvs(3) # _WAFODIST = ppimport('wafo.stats.distributions')
import matplotlib # #nbinom(10, 0.75).rvs(3)
matplotlib.interactive(True) # import matplotlib
t = _WAFODIST.bernoulli(0.75).rvs(3) # matplotlib.interactive(True)
x = np.r_[5, 10] # t = _WAFODIST.bernoulli(0.75).rvs(3)
npr = np.r_[9, 9] # x = np.r_[5, 10]
t2 = _WAFODIST.bd0(x, npr) # npr = np.r_[9, 9]
#Examples MLE and better CI for phat.par[0] # t2 = _WAFODIST.bd0(x, npr)
R = _WAFODIST.weibull_min.rvs(1, size=100); # #Examples MLE and better CI for phat.par[0]
phat = _WAFODIST.weibull_min.fit(R, 1, 1, par_fix=[nan, 0, nan]) # R = _WAFODIST.weibull_min.rvs(1, size=100);
Lp = phat.profile(i=0) # phat = _WAFODIST.weibull_min.fit(R, 1, 1, par_fix=[nan, 0, nan])
Lp.plot() # Lp = phat.profile(i=0)
Lp.get_CI(alpha=0.1) # Lp.plot()
R = 1. / 990 # Lp.get_CI(alpha=0.1)
x = phat.isf(R) # R = 1. / 990
# x = phat.isf(R)
# CI for x #
Lx = phat.profile(i=0, x=x) # # CI for x
Lx.plot() # Lx = phat.profile(i=0, x=x)
Lx.get_CI(alpha=0.2) # Lx.plot()
# Lx.get_CI(alpha=0.2)
# CI for logSF=log(SF) #
Lpr = phat.profile(i=0, logSF=log(R), link=phat.dist.link) # # CI for logSF=log(SF)
Lpr.plot() # Lpr = phat.profile(i=0, logSF=log(R), link=phat.dist.link)
Lpr.get_CI(alpha=0.075) # Lpr.plot()
# Lpr.get_CI(alpha=0.075)
_WAFODIST.dlaplace.stats(0.8, loc=0) #
# pass # _WAFODIST.dlaplace.stats(0.8, loc=0)
t = _WAFODIST.planck(0.51000000000000001) ## pass
t.ppf(0.5) # t = _WAFODIST.planck(0.51000000000000001)
t = _WAFODIST.zipf(2) # t.ppf(0.5)
t.ppf(0.5) # t = _WAFODIST.zipf(2)
import pylab as plb # t.ppf(0.5)
_WAFODIST.rice.rvs(1) # import pylab as plb
x = plb.linspace(-5, 5) # _WAFODIST.rice.rvs(1)
y = _WAFODIST.genpareto.cdf(x, 0) # x = plb.linspace(-5, 5)
#plb.plot(x,y) # y = _WAFODIST.genpareto.cdf(x, 0)
#plb.show() # #plb.plot(x,y)
# #plb.show()
#
on = ones((2, 3)) #
r = _WAFODIST.genpareto.rvs(0, size=100) # on = ones((2, 3))
pht = _WAFODIST.genpareto.fit(r, 1, par_fix=[0, 0, nan]) # r = _WAFODIST.genpareto.rvs(0, size=100)
lp = pht.profile() # pht = _WAFODIST.genpareto.fit(r, 1, par_fix=[0, 0, nan])
# lp = pht.profile()
if __name__ == '__main__': if __name__ == '__main__':
main() main()

Loading…
Cancel
Save