econmethods 3.0.2__tar.gz → 3.0.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: econmethods
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: A python package implementing various econometrical tests and estimators
5
5
  Home-page: https://github.com/NaturionBG/econmethods
6
6
  Author: NaturionBG
@@ -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
- lr_fe = lr_fe.drop(columns=[coef])
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
@@ -513,7 +516,11 @@ class FECM:
513
516
  est.append(sm.OLS(model['target_diff'], sm.add_constant(model.iloc[:, 3:])).fit())
514
517
  else:
515
518
  est.append(sm.OLS(model['target_diff'], model.iloc[:, 3:]).fit())
516
- self.__ccemg_units[i] = self.__ccemg_units[i].drop(columns=drop)
519
+ if 'const' not in drop:
520
+ self.__ccemg_units[i] = self.__ccemg_units[i].drop(columns=drop)
521
+ else:
522
+ self.__C = False
523
+ drop = drop.remove('const')
517
524
  return est
518
525
  elif self.__method == 'mg':
519
526
  units = self.__mg_units
@@ -523,7 +530,11 @@ class FECM:
523
530
  est.append(sm.OLS(model['target_diff'], sm.add_constant(model.iloc[:, 3:])).fit())
524
531
  else:
525
532
  est.append(sm.OLS(model['target_diff'], model.iloc[:, 3:]).fit())
526
- self.__ccemg_units[i] = self.__ccemg_units[i].drop(columns=drop)
533
+ if 'const' not in drop:
534
+ self.__mg_units[i] = self.__mg_units[i].drop(columns=drop)
535
+ else:
536
+ self.__C = False
537
+ drop = drop.remove('const')
527
538
  return est
528
539
  elif self.__method == 'ccep':
529
540
  units = self.get_ccemg_frames(self.__lag)
@@ -538,7 +549,11 @@ class FECM:
538
549
  ts = []
539
550
  flag = True
540
551
  if max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[1] > self.sf:
541
- pool = pool.drop(columns=[max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[0]])
552
+ to_drop = max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[0]
553
+ if to_drop != 'const':
554
+ pool = pool.drop(columns=[to_drop])
555
+ else:
556
+ self.__C = False
542
557
  flag=False
543
558
  for i in self.x_difs:
544
559
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: econmethods
3
- Version: 3.0.2
3
+ Version: 3.0.3
4
4
  Summary: A python package implementing various econometrical tests and estimators
5
5
  Home-page: https://github.com/NaturionBG/econmethods
6
6
  Author: NaturionBG
@@ -5,7 +5,7 @@ with open('README.md', 'r') as f:
5
5
 
6
6
  setup(
7
7
  name = 'econmethods',
8
- version = 'v3.0.2',
8
+ version = 'v3.0.3',
9
9
  description='A python package implementing various econometrical tests and estimators',
10
10
  packages = find_packages(),
11
11
  long_description=long_desc,
File without changes
File without changes