Skip to content

Commit d21d4fc

Browse files
authored
Merge pull request #31 from mu373/fix-return-data-type
Fix return data type
2 parents f3e2b7f + 9a236e4 commit d21d4fc

23 files changed

+920
-519
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ data = TailData(name='CAIDA_KONECT').data
3636
estimator = HillEstimator()
3737
estimator.fit(data)
3838

39-
# Get the estimated parameters
40-
result = estimator.get_parameters()
39+
# Get the estimated results
40+
result = estimator.get_result()
4141

4242
# Get the power law exponent
43-
gamma = result.gamma
43+
gamma = result.gamma_
4444

4545
# Print full results
4646
print(result)
@@ -59,11 +59,11 @@ degree = list(dict(G.degree()).values()) # Degree sequence
5959
estimator = HillEstimator()
6060
estimator.fit(degree)
6161

62-
# Get the estimated parameters
63-
result = estimator.get_parameters()
62+
# Get the estimated results
63+
result = estimator.get_result()
6464

6565
# Get the power law exponent
66-
gamma = result.gamma
66+
gamma = result.gamma_
6767

6868
# Print full results
6969
print(result)
@@ -87,10 +87,10 @@ The package provides several estimators for tail estimation. For details on para
8787
- Smoothed version of the Hill estimator (no bootstrap)
8888

8989
## Results
90-
The full result can be obtained by `estimator.get_parameters()`, which returns a dictionary. This includes:
91-
- `gamma`: Power law exponent (γ = 1 + 1/ξ)
92-
- `xi_star`: Tail index (ξ)
93-
- `k_star`: Optimal order statistic
90+
The full result can be obtained by `estimator.get_result()`, which is a TailEstimatorResult object. This includes attributes such as:
91+
- `gamma_`: Power law exponent (γ = 1 + 1/ξ)
92+
- `xi_star_`: Tail index (ξ)
93+
- `k_star_`: Optimal order statistic
9494
- Bootstrap results (when applicable):
9595
- First and second bootstrap AMSE values
9696
- Optimal bandwidths or minimum AMSE fractions

docs/estimators/hill.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Examples
2222
hill = HillEstimator()
2323
hill.fit(data)
2424
25-
# Get estimated parameters
26-
params = hill.get_parameters()
25+
# Get estimated values
26+
res = hill.get_result()

docs/estimators/kernel.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ Examples
2727
)
2828
kernel.fit(data)
2929
30-
# Get estimated parameters
31-
params = kernel.get_parameters()
30+
# Get estimated values
31+
res = kernel.get_result()

docs/estimators/moments.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ Examples
2323
moments = MomentsEstimator()
2424
moments.fit(data)
2525
26-
# Get estimated parameters
27-
params = moments.get_parameters()
26+
# Get estimated values
27+
res = moments.get_result()

docs/estimators/pickands.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ Examples
2222
pickands = PickandsEstimator()
2323
pickands.fit(data)
2424
25-
# Get estimated parameters
26-
params = pickands.get_parameters()
25+
# Get estimated values
26+
res = pickands.get_result()

docs/estimators/smooth_hill.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ Examples
2222
smooth_hill = SmoothHillEstimator()
2323
smooth_hill.fit(data)
2424
25-
# Get estimated parameters
26-
params = smooth_hill.get_parameters()
25+
# Get estimated values
26+
res = smooth_hill.get_result()
2727

docs/result.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ Examples
1919
hill = HillEstimator()
2020
hill.fit(data)
2121
22-
# Get estimated parameters
23-
result = hill.get_parameters() # This returns TailEstimatorResult class.
22+
# Get estimated values
23+
result = hill.get_result() # This returns TailEstimatorResult class.
2424
print(result)
2525
2626
# Access individual parameters
27-
gamma = result.gamma # Power-law exponent estimate
28-
xi = result.xi # Tail index estimate
27+
gamma = result.gamma_ # Power-law exponent estimate
28+
xi = result.xi_ # Tail index estimate
2929

docs/usage.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Using Built-in Datasets
3232
estimator = HillEstimator()
3333
estimator.fit(data)
3434
35-
# Get the estimated parameters
36-
result = estimator.get_parameters()
37-
gamma = result.gamma
35+
# Get estimated values
36+
result = estimator.get_result()
37+
gamma = result.gamma_
3838
3939
# Print full results
4040
print(result)
@@ -55,9 +55,9 @@ Using degree sequence from networkx graphs
5555
estimator = HillEstimator()
5656
estimator.fit(degree)
5757
58-
# Get the estimated parameters
59-
result = estimator.get_parameters()
60-
gamma = result.gamma
58+
# Get estimated values
59+
result = estimator.get_result()
60+
gamma = result.gamma_
6161
6262
# Print full results
6363
print(result)
@@ -84,11 +84,11 @@ The package provides several estimators for tail estimation. For details on each
8484
Results
8585
-------
8686

87-
The full result can be obtained by ``result = estimator.get_parameters()``. You can either print the result, or access individual attributes (e.g., `result.gamma`). The output will include:
87+
The full result can be obtained by ``result = estimator.get_result()``. You can either print the result, or access individual attributes (e.g., `result.gamma_`). The output will include values such as:
8888

89-
- ``gamma``: Power law exponent (γ = 1 + 1/ξ)
90-
- ``xi_star``: Tail index (ξ)
91-
- ``k_star``: Optimal order statistic
89+
- ``gamma_``: Power law exponent (γ = 1 + 1/ξ)
90+
- ``xi_star_``: Tail index (ξ)
91+
- ``k_star_``: Optimal order statistic
9292
- Bootstrap results (when applicable):
9393
- First and second bootstrap AMSE values
9494
- Optimal bandwidths or minimum AMSE fractions

examples/example.ipynb

Lines changed: 99 additions & 33 deletions
Large diffs are not rendered by default.

examples/example.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
estimator.fit(data)
1616
print(estimator)
1717

18-
# Get the estimated parameters
19-
result = estimator.get_parameters()
18+
# Get the parameters of the estimator
19+
params = estimator.get_params()
20+
21+
# Get estimated values
22+
result = estimator.get_result()
2023

2124
# Get the power law exponent
22-
gamma = result.gamma
25+
gamma = result.gamma_
2326

2427
# Print full results
2528
print(result)

0 commit comments

Comments
 (0)