econmethods 2__tar.gz → 2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {econmethods-2 → econmethods-2.1}/PKG-INFO +1 -1
- {econmethods-2 → econmethods-2.1}/econmethods/Lib.py +11 -4
- {econmethods-2 → econmethods-2.1}/econmethods.egg-info/PKG-INFO +1 -1
- {econmethods-2 → econmethods-2.1}/setup.py +1 -1
- {econmethods-2 → econmethods-2.1}/README.md +0 -0
- {econmethods-2 → econmethods-2.1}/econmethods/CADF_Crit_Values.xlsx +0 -0
- {econmethods-2 → econmethods-2.1}/econmethods/__init__.py +0 -0
- {econmethods-2 → econmethods-2.1}/econmethods.egg-info/SOURCES.txt +0 -0
- {econmethods-2 → econmethods-2.1}/econmethods.egg-info/dependency_links.txt +0 -0
- {econmethods-2 → econmethods-2.1}/econmethods.egg-info/requires.txt +0 -0
- {econmethods-2 → econmethods-2.1}/econmethods.egg-info/top_level.txt +0 -0
- {econmethods-2 → econmethods-2.1}/setup.cfg +0 -0
|
@@ -45,12 +45,13 @@ class CipsTest:
|
|
|
45
45
|
the test will choose the best lag amount from 1 to n_lags based on AIC (Akaike Information Criterion)
|
|
46
46
|
|
|
47
47
|
- *level*: Value of significance to conduct the test at (in %%). Only 5 and 1% are allowed.
|
|
48
|
+
- *log_target*: Specify whether the test shall aplly a natural logarithm to your target variable. Defaults to True.
|
|
48
49
|
-----------------------------
|
|
49
50
|
RETURNS:
|
|
50
51
|
--
|
|
51
52
|
via instance.verdict() -> None: Prints the verdict of the test based on the parameters set by the user.
|
|
52
53
|
'''
|
|
53
|
-
def __init__(self, df: pd.DataFrame, T: int, N: int, trend: bool = False, poly_trend: int = 1, intercept: bool = False, n_lags: int = 2, level: int = 5) -> None:
|
|
54
|
+
def __init__(self, df: pd.DataFrame, T: int, N: int, trend: bool = False, poly_trend: int = 1, intercept: bool = False, n_lags: int = 2, level: int = 5, log_target: bool = True) -> None:
|
|
54
55
|
CipsTest.__build_tables()
|
|
55
56
|
self.__df = df
|
|
56
57
|
self.__L = 1
|
|
@@ -65,7 +66,8 @@ class CipsTest:
|
|
|
65
66
|
self.__n_lags = 1
|
|
66
67
|
self.__alpha = level/100
|
|
67
68
|
self.__df = self.__df.rename(columns={self.__df.columns[0]:'SpUnit', self.__df.columns[1]:'time', self.__df.columns[2]:'target'})
|
|
68
|
-
|
|
69
|
+
if log_target:
|
|
70
|
+
self.__df.target = np.log(self.__df.target)
|
|
69
71
|
self.__poly = poly_trend
|
|
70
72
|
if self.__trend:
|
|
71
73
|
if self.__poly > 1:
|
|
@@ -632,6 +634,7 @@ class SlopeHomogeneityF:
|
|
|
632
634
|
</ul>
|
|
633
635
|
<li> <strong>level</strong>: Your significance level to test at. Defaults to 5%.</li>
|
|
634
636
|
<li> <strong>intercept</strong>: Specify whether your model has an intercept. Defaults to True.</li>
|
|
637
|
+
<li> <strong>skip_premise</strong>: Set to True if you wish to ignore heteroskedasticity. Not a recommended option, parameter defaults to False</li>
|
|
635
638
|
</ul>
|
|
636
639
|
<hr>
|
|
637
640
|
<h3><em>Note that this test has got certain assumptions, such as error homoskedasticity, N < T.
|
|
@@ -642,12 +645,13 @@ class SlopeHomogeneityF:
|
|
|
642
645
|
<li>Via the instance.verdict() method - prints the result of the F-test.</li>
|
|
643
646
|
</ol>
|
|
644
647
|
'''
|
|
645
|
-
def __init__(self, df: pd.DataFrame, level: int = 5, intercept: bool = True) -> None:
|
|
648
|
+
def __init__(self, df: pd.DataFrame, level: int = 5, intercept: bool = True, skip_premise: bool = False) -> None:
|
|
646
649
|
self.__df = df
|
|
647
650
|
self.__l = []
|
|
648
651
|
self.__C = intercept
|
|
649
652
|
self.__alpha = level/100
|
|
650
653
|
self.__k = 0
|
|
654
|
+
self.__skip = skip_premise
|
|
651
655
|
for i, ex in enumerate(self.__df.columns[3:], 1):
|
|
652
656
|
self.__k +=1
|
|
653
657
|
self.__l.append(f'x{i}')
|
|
@@ -661,7 +665,10 @@ class SlopeHomogeneityF:
|
|
|
661
665
|
if self.__N > self.__T:
|
|
662
666
|
raise AssertionError('The F-test for slope Homogeneity assumes that N< T!')
|
|
663
667
|
if self.__homo_res[1] < self.__alpha:
|
|
664
|
-
|
|
668
|
+
if not self.__skip:
|
|
669
|
+
raise AssertionError('The Data contains Heteroskedastic errors according to the Goldfeld-Quandt test!')
|
|
670
|
+
else:
|
|
671
|
+
pass
|
|
665
672
|
|
|
666
673
|
def fit(self) -> float | int:
|
|
667
674
|
USSR = 0
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|