econmethods 3.0.2__tar.gz → 3.0.4__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-3.0.2 → econmethods-3.0.4}/PKG-INFO +1 -1
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods/Lib.py +29 -6
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods.egg-info/PKG-INFO +1 -1
- {econmethods-3.0.2 → econmethods-3.0.4}/setup.py +1 -1
- {econmethods-3.0.2 → econmethods-3.0.4}/README.md +0 -0
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods/CADF_Crit_Values.xlsx +0 -0
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods/__init__.py +0 -0
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods.egg-info/SOURCES.txt +0 -0
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods.egg-info/dependency_links.txt +0 -0
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods.egg-info/requires.txt +0 -0
- {econmethods-3.0.2 → econmethods-3.0.4}/econmethods.egg-info/top_level.txt +0 -0
- {econmethods-3.0.2 → econmethods-3.0.4}/setup.cfg +0 -0
|
@@ -444,7 +444,10 @@ class FECM:
|
|
|
444
444
|
flag = True
|
|
445
445
|
for coef, t in zip(res_lr.params.index, res_lr.pvalues):
|
|
446
446
|
if t > self.sf:
|
|
447
|
-
|
|
447
|
+
if coef != 'const':
|
|
448
|
+
lr_fe = lr_fe.drop(columns=[coef])
|
|
449
|
+
else:
|
|
450
|
+
self.__lr_c = False
|
|
448
451
|
flag=False
|
|
449
452
|
if flag:
|
|
450
453
|
break
|
|
@@ -508,22 +511,38 @@ class FECM:
|
|
|
508
511
|
if self.__method == 'ccemg':
|
|
509
512
|
units = self.__ccemg_units
|
|
510
513
|
for i, model in enumerate(units):
|
|
511
|
-
|
|
514
|
+
if 'const' not in drop:
|
|
515
|
+
model = model.drop(columns=drop)
|
|
516
|
+
else:
|
|
517
|
+
self.__C = False
|
|
518
|
+
drop = drop.remove('const')
|
|
512
519
|
if self.__C:
|
|
513
520
|
est.append(sm.OLS(model['target_diff'], sm.add_constant(model.iloc[:, 3:])).fit())
|
|
514
521
|
else:
|
|
515
522
|
est.append(sm.OLS(model['target_diff'], model.iloc[:, 3:]).fit())
|
|
516
|
-
|
|
523
|
+
if 'const' not in drop:
|
|
524
|
+
self.__ccemg_units[i] = self.__ccemg_units[i].drop(columns=drop)
|
|
525
|
+
else:
|
|
526
|
+
self.__C = False
|
|
527
|
+
drop = drop.remove('const')
|
|
517
528
|
return est
|
|
518
529
|
elif self.__method == 'mg':
|
|
519
530
|
units = self.__mg_units
|
|
520
531
|
for i, model in enumerate(units):
|
|
521
|
-
|
|
532
|
+
if 'const' not in drop:
|
|
533
|
+
model = model.drop(columns=drop)
|
|
534
|
+
else:
|
|
535
|
+
self.__C = False
|
|
536
|
+
drop = drop.remove('const')
|
|
522
537
|
if self.__C:
|
|
523
538
|
est.append(sm.OLS(model['target_diff'], sm.add_constant(model.iloc[:, 3:])).fit())
|
|
524
539
|
else:
|
|
525
540
|
est.append(sm.OLS(model['target_diff'], model.iloc[:, 3:]).fit())
|
|
526
|
-
|
|
541
|
+
if 'const' not in drop:
|
|
542
|
+
self.__mg_units[i] = self.__mg_units[i].drop(columns=drop)
|
|
543
|
+
else:
|
|
544
|
+
self.__C = False
|
|
545
|
+
drop = drop.remove('const')
|
|
527
546
|
return est
|
|
528
547
|
elif self.__method == 'ccep':
|
|
529
548
|
units = self.get_ccemg_frames(self.__lag)
|
|
@@ -538,7 +557,11 @@ class FECM:
|
|
|
538
557
|
ts = []
|
|
539
558
|
flag = True
|
|
540
559
|
if max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[1] > self.sf:
|
|
541
|
-
|
|
560
|
+
to_drop = max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[0]
|
|
561
|
+
if to_drop != 'const':
|
|
562
|
+
pool = pool.drop(columns=[to_drop])
|
|
563
|
+
else:
|
|
564
|
+
self.__C = False
|
|
542
565
|
flag=False
|
|
543
566
|
for i in self.x_difs:
|
|
544
567
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|