... from pacal import *
|
||
.
|
||
Using compiled interpolation routine
... from pylab import figure, show
def Hill_estim_distr(d, n, xmin):
"""The distribution of Hill's estimator for given distribution d
>= xmin and sample size n."""
s = log(d / xmin)
for i in xrange(n - 1):
s += log(d / xmin)
return 1 + n / s
a = Hill_estim_distr(ParetoDistr(2, 1), 5, 1)
a.summary()
|
||
.
|
||
============= summary ============= (5.0*((1/(log(Pareto(2,1))+log(Pareto(2,1))+log(Pareto(2,1))+log(Pareto(2,1))+log(Pareto(2,1))))))+1 mean = 3.5 std = 1.44337567297 var = 2.08333333333 median = 3.14091095565 medianad = 0.638370086855 iqrange(0.025) = 5.18317249607 range = (1.0, inf) ci(0.05) = (1.9764110156084711, 7.1595835116738193) int_err = -1.11022302463e-15
... a.plot()
show()
|
||
.
|
||
... figure()
a = Hill_estim_distr(ParetoDistr(1, 1), 10, 1)
a.summary()
|
||
.
|
||
============= summary ============= (10.0*((1/(log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))+log(Pareto(1,1))))))+1 mean = 2.11111111111 std = 0.392837100659 var = 0.154320987654 median = 2.03426364294 medianad = 0.219358331595 iqrange(0.025) = 1.50002120798 range = (1.0, inf) ci(0.05) = (1.585315483928994, 3.0853366919065133) int_err = -1.90958360236e-14
... a.plot()
show()
|
||
.
|
||