Skip to content

Commit d9454de

Browse files
committed
init
1 parent 5fff4e5 commit d9454de

File tree

7 files changed

+195
-270
lines changed

7 files changed

+195
-270
lines changed

criterion/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@
103103
WPPWeibullTestStatistic,
104104
)
105105

106+
106107
__all__ = [
107108
"AbstractTestStatistic",
108109
"ADTestStatistic",

criterion/exponent.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,7 @@ def execute_statistic(self, rvs, **kwargs):
285285
rvs.sort()
286286
x = np.concatenate(([0], rvs))
287287
d = (np.arange(n, 0, -1)) * (x[1 : n + 1] - x[0:n])
288-
eps = (
289-
2
290-
* n
291-
* (np.log(np.sum(d) / n) - (np.sum(np.log(d))) / n)
292-
/ (1 + (n + 1) / (6 * n))
293-
)
288+
eps = 2 * n * (np.log(np.sum(d) / n) - (np.sum(np.log(d))) / n) / (1 + (n + 1) / (6 * n))
294289

295290
return eps
296291

@@ -424,9 +419,7 @@ def execute_statistic(self, rvs, r=None):
424419
n = len(rvs)
425420
x = np.sort(np.concatenate(([0], rvs)))
426421
d = (np.arange(n, 0, -1)) * (x[1 : n + 1] - x[:n])
427-
hm = ((np.sum(d[:r]) + np.sum(d[-r:])) / (2 * r)) / (
428-
(np.sum(d[r:-r])) / (n - 2 * r)
429-
)
422+
hm = ((np.sum(d[:r]) + np.sum(d[-r:])) / (2 * r)) / ((np.sum(d[r:-r])) / (n - 2 * r))
430423

431424
return hm
432425

@@ -820,9 +813,7 @@ def execute_statistic(self, rvs, **kwargs):
820813
return hg
821814

822815

823-
class GraphEdgesNumberExpTest(
824-
AbstractExponentialityTestStatistic, GraphEdgesNumberTestStatistic
825-
):
816+
class GraphEdgesNumberExpTest(AbstractExponentialityTestStatistic, GraphEdgesNumberTestStatistic):
826817
@staticmethod
827818
@override
828819
def code():
@@ -831,9 +822,7 @@ def code():
831822
return f"EdgesNumber_{parent_code}"
832823

833824

834-
class GraphMaxDegreeExpTest(
835-
AbstractExponentialityTestStatistic, GraphMaxDegreeTestStatistic
836-
):
825+
class GraphMaxDegreeExpTest(AbstractExponentialityTestStatistic, GraphMaxDegreeTestStatistic):
837826
@staticmethod
838827
@override
839828
def code():

criterion/models.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ def execute_statistic(self, rvs, **kwargs) -> Union[float, float64]:
2424
"""
2525
raise NotImplementedError("Method is not implemented")
2626

27-
def calculate_critical_value(
28-
self, rvs_size, sl
29-
) -> Union[Optional[float], Optional[float64]]:
27+
def calculate_critical_value(self, rvs_size, sl) -> Union[Optional[float], Optional[float64]]:
3028
"""
3129
Calculate critical value for test statistics
3230
:param rvs_size: rvs size

0 commit comments

Comments
 (0)