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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: econmethods
3
- Version: 3.0.2
3
+ Version: 3.0.4
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
@@ -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
- model = model.drop(columns=drop)
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
- self.__ccemg_units[i] = self.__ccemg_units[i].drop(columns=drop)
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
- model = model.drop(columns=drop)
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
- self.__ccemg_units[i] = self.__ccemg_units[i].drop(columns=drop)
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
- pool = pool.drop(columns=[max(zip(est[0].params.index, est[0].pvalues), key=lambda x: x[1])[0]])
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:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: econmethods
3
- Version: 3.0.2
3
+ Version: 3.0.4
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.4',
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