econmethods 2.9__tar.gz → 3__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.9 → econmethods-3}/PKG-INFO +1 -1
- {econmethods-2.9 → econmethods-3}/econmethods/Lib.py +21 -7
- {econmethods-2.9 → econmethods-3}/econmethods.egg-info/PKG-INFO +1 -1
- {econmethods-2.9 → econmethods-3}/setup.py +1 -1
- {econmethods-2.9 → econmethods-3}/README.md +0 -0
- {econmethods-2.9 → econmethods-3}/econmethods/CADF_Crit_Values.xlsx +0 -0
- {econmethods-2.9 → econmethods-3}/econmethods/__init__.py +0 -0
- {econmethods-2.9 → econmethods-3}/econmethods.egg-info/SOURCES.txt +0 -0
- {econmethods-2.9 → econmethods-3}/econmethods.egg-info/dependency_links.txt +0 -0
- {econmethods-2.9 → econmethods-3}/econmethods.egg-info/requires.txt +0 -0
- {econmethods-2.9 → econmethods-3}/econmethods.egg-info/top_level.txt +0 -0
- {econmethods-2.9 → econmethods-3}/setup.cfg +0 -0
|
@@ -278,7 +278,6 @@ class HausmanOneWay:
|
|
|
278
278
|
def __del__(self) -> None:
|
|
279
279
|
pass
|
|
280
280
|
|
|
281
|
-
|
|
282
281
|
class FECM:
|
|
283
282
|
'''
|
|
284
283
|
The implementation of a first-order ECM (Error Correction Model) estimation for panel data.
|
|
@@ -329,6 +328,7 @@ class FECM:
|
|
|
329
328
|
self.__autorem = autorem
|
|
330
329
|
self.__C = intercept
|
|
331
330
|
self.__lag = n_lags
|
|
331
|
+
self.x_difs = []
|
|
332
332
|
self.__method = method.lower()
|
|
333
333
|
self.__exog = len(df.columns[3:])
|
|
334
334
|
self.__l =[]
|
|
@@ -342,6 +342,7 @@ class FECM:
|
|
|
342
342
|
self.__stat_vars.columns = ['SpUnit', 'time'] + self.__stat
|
|
343
343
|
for i in range(1, self.__exog+1):
|
|
344
344
|
self.__l.append(f'x{i}')
|
|
345
|
+
self.x_difs.append(f'x{i}_diff')
|
|
345
346
|
self.__mean_names.append(f'x{i}_avg')
|
|
346
347
|
self.__df.columns = ['SpUnit', 'time', 'target'] + self.__l
|
|
347
348
|
if isinstance(coint, list):
|
|
@@ -514,11 +515,20 @@ class FECM:
|
|
|
514
515
|
est.append(sm.OLS(pool['target_diff'], pool.iloc[:, 3:]).fit())
|
|
515
516
|
if self.__autorem:
|
|
516
517
|
while True:
|
|
518
|
+
ts = []
|
|
517
519
|
flag = True
|
|
518
520
|
if max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[1] > 0.06:
|
|
519
521
|
pool = pool.drop(columns=[max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[0]])
|
|
520
522
|
flag=False
|
|
521
|
-
|
|
523
|
+
for i in self.x_difs:
|
|
524
|
+
try:
|
|
525
|
+
tmp = est[0].pvalues[i] <= 0.05
|
|
526
|
+
if tmp:
|
|
527
|
+
ts.append(1)
|
|
528
|
+
except Exception:
|
|
529
|
+
ts.append(1)
|
|
530
|
+
|
|
531
|
+
if flag or len(ts) == len(self.x_difs):
|
|
522
532
|
break
|
|
523
533
|
else:
|
|
524
534
|
if self.__C:
|
|
@@ -559,11 +569,19 @@ class FECM:
|
|
|
559
569
|
res = self.mg_algorithm()
|
|
560
570
|
if self.__autorem:
|
|
561
571
|
while True:
|
|
572
|
+
ts = []
|
|
562
573
|
flag = True
|
|
563
574
|
if max(zip(res['coefs'].index, res['coefs']['T-pvalues']), key=lambda x: x[1])[1] > 0.06:
|
|
564
575
|
self.__sr = self.build_sr([max(zip(res['coefs'].index, res['coefs']['T-pvalues']), key=lambda x: x[1])[0]])
|
|
565
576
|
flag=False
|
|
566
|
-
|
|
577
|
+
for i in self.x_difs:
|
|
578
|
+
try:
|
|
579
|
+
tmp = res['coefs']['T-pvalues'][i] <= 0.05
|
|
580
|
+
if tmp:
|
|
581
|
+
ts.append(1)
|
|
582
|
+
except Exception:
|
|
583
|
+
ts.append(1)
|
|
584
|
+
if flag or len(ts) == len(self.x_difs):
|
|
567
585
|
break
|
|
568
586
|
else:
|
|
569
587
|
res = self.mg_algorithm()
|
|
@@ -573,10 +591,6 @@ class FECM:
|
|
|
573
591
|
|
|
574
592
|
def __del__(self) -> None:
|
|
575
593
|
pass
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
594
|
class CDTwoWay:
|
|
581
595
|
'''
|
|
582
596
|
Implementation of the CD test to validate/reject cross-sectional dependence.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|