mergeron 2024.739145.4__tar.gz → 2024.739145.6__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.

Potentially problematic release.


This version of mergeron might be problematic. Click here for more details.

Files changed (24) hide show
  1. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/PKG-INFO +2 -1
  2. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/pyproject.toml +6 -6
  3. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/__init__.py +2 -2
  4. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/core/guidelines_boundaries.py +21 -23
  5. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/core/guidelines_boundary_functions.py +49 -41
  6. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/core/guidelines_boundary_functions_extra.py +3 -3
  7. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/gen/__init__.py +3 -4
  8. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/gen/data_generation.py +2 -2
  9. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/gen/data_generation_functions.py +4 -5
  10. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/gen/upp_tests.py +1 -1
  11. mergeron-2024.739145.4/src/mergeron/License.txt +0 -16
  12. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/README.rst +0 -0
  13. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/core/__init__.py +0 -0
  14. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/core/empirical_margin_distribution.py +0 -0
  15. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/core/ftc_merger_investigations_data.py +0 -0
  16. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/core/pseudorandom_numbers.py +0 -0
  17. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/data/__init__.py +0 -0
  18. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/data/damodaran_margin_data.xls +0 -0
  19. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/data/damodaran_margin_data_dict.msgpack +0 -0
  20. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/data/ftc_invdata.msgpack +0 -0
  21. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/demo/__init__.py +0 -0
  22. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/demo/visualize_empirical_margin_distribution.py +0 -0
  23. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/gen/enforcement_stats.py +0 -0
  24. {mergeron-2024.739145.4 → mergeron-2024.739145.6}/src/mergeron/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mergeron
3
- Version: 2024.739145.4
3
+ Version: 2024.739145.6
4
4
  Summary: Merger Policy Analysis using Python
5
5
  License: MIT
6
6
  Keywords: merger policy analysis,merger guidelines,merger screening,policy presumptions,concentration standards,upward pricing pressure,GUPPI
@@ -16,6 +16,7 @@ Classifier: Operating System :: OS Independent
16
16
  Classifier: Programming Language :: Python
17
17
  Classifier: Programming Language :: Python :: 3
18
18
  Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
19
20
  Classifier: Programming Language :: Python :: 3 :: Only
20
21
  Classifier: Programming Language :: Python :: Implementation :: CPython
21
22
  Requires-Dist: aenum (>=3.1.15,<4.0.0)
@@ -13,7 +13,7 @@ keywords = [
13
13
  "upward pricing pressure",
14
14
  "GUPPI",
15
15
  ]
16
- version = "2024.739145.4"
16
+ version = "2024.739145.6"
17
17
 
18
18
  # Classifiers list: https://pypi.org/classifiers/
19
19
  classifiers = [
@@ -130,7 +130,7 @@ select = [
130
130
  "S", # flake8-bandit
131
131
  "SIM", # flake8-simplify
132
132
  "TID", # flake8-tidy-imports
133
- "TCH", # flake8-type-checking
133
+ "TC", # flake8-type-checking
134
134
  "UP", # pyupgrade
135
135
  "RUF", # ruff-specific
136
136
  ]
@@ -148,9 +148,9 @@ ignore = [
148
148
  'B905',
149
149
  "PLR2004", # avoid magic values
150
150
  # flake8-type-checking
151
- "TCH001", # move application import into a type-checking block
152
- "TCH002", # move third-party import into a type-checking block
153
- "TCH003", # move third-party import into a type-checking block
151
+ "TC001", # move application import into a type-checking block
152
+ "TC002", # move third-party import into a type-checking block
153
+ "TC003", # move third-party import into a type-checking block
154
154
  # Use typing.TypeAlias for now:
155
155
  # mypy yet to implements PEP 695 type aliases;
156
156
  # sphinx (as setup here) gives different results with TypeAlias and typing statement
@@ -169,7 +169,7 @@ preview = true
169
169
  python_version = "3.12"
170
170
  ignore_missing_imports = false
171
171
  strict = true
172
- enable_incomplete_feature = ["NewGenericSyntax", "PreciseTupleTypes"]
172
+ enable_incomplete_feature = ["PreciseTupleTypes"]
173
173
 
174
174
  show_column_numbers = true
175
175
  show_error_codes = true
@@ -8,7 +8,7 @@ from numpy.typing import NDArray
8
8
 
9
9
  _PKG_NAME: str = Path(__file__).parent.stem
10
10
 
11
- VERSION = "2024.739145.4"
11
+ VERSION = "2024.739145.6"
12
12
 
13
13
  __version__ = VERSION
14
14
 
@@ -30,7 +30,7 @@ type ArrayINT = NDArray[np.intp]
30
30
  type ArrayDouble = NDArray[np.double]
31
31
  type ArrayBIGINT = NDArray[np.int64]
32
32
 
33
- DEFAULT_REC_RATE = 0.85
33
+ DEFAULT_REC_RATIO = 0.85
34
34
 
35
35
 
36
36
  @enum.unique
@@ -15,13 +15,12 @@ from attrs import Attribute, field, frozen, validators
15
15
  from mpmath import mp, mpf # type: ignore
16
16
 
17
17
  from .. import ( # noqa: TID252
18
- DEFAULT_REC_RATE,
18
+ DEFAULT_REC_RATIO,
19
19
  VERSION,
20
20
  ArrayDouble,
21
21
  RECForm,
22
22
  UPPAggrSelector,
23
23
  )
24
- from . import MPFloat
25
24
  from . import guidelines_boundary_functions as gbfn
26
25
 
27
26
  __version__ = VERSION
@@ -30,7 +29,7 @@ __version__ = VERSION
30
29
  mp.dps = 32
31
30
  mp.trap_complex = True
32
31
 
33
- type HMGPubYear = Literal[1992, 2004, 2010, 2023]
32
+ type HMGPubYear = Literal[1982, 1984, 1992, 2010, 2023]
34
33
 
35
34
 
36
35
  @dataclass(frozen=True)
@@ -51,19 +50,15 @@ class GuidelinesThresholds:
51
50
 
52
51
  ΔHHI, Recapture Ratio, GUPPI, Diversion ratio, CMCR, and IPR thresholds
53
52
  constructed from concentration standards in Guidelines published in
54
- 1992, 2004, 2010, and 2023.
55
-
56
- The 2004 Guidelines refernced here are the EU Commission
57
- guidelines on assessment of horizontal mergers. These
58
- guidelines also define a presumption for mergers with
59
- post-merger HHI in [1000, 2000) and ΔHHI >= 250 points,
60
- whi is not modeled here.
61
-
62
- All other Guidelines modeled here are U.S. merger guidelines.
53
+ 1982, 1984, 1992, 2010, and 2023.
63
54
 
64
55
  """
65
56
 
66
- pub_year: HMGPubYear
57
+ pub_year: HMGPubYear = field(
58
+ kw_only=True,
59
+ default=2023,
60
+ validator=validators.in_([1982, 1984, 1992, 2010, 2023]),
61
+ )
67
62
  """
68
63
  Year of publication of the Guidelines
69
64
  """
@@ -101,9 +96,10 @@ class GuidelinesThresholds:
101
96
  # thus, here, the tentative delta safeharbor under
102
97
  # the 2023 Guidelines is 100 points
103
98
  _hhi_p, _dh_s, _dh_p = {
104
- 1992: (0.18, 0.005, 0.01),
99
+ 1982: (_s1982 := (0.18, 0.005, 0.01)),
100
+ 1984: _s1982,
101
+ 1992: _s1982,
105
102
  2010: (0.25, 0.01, 0.02),
106
- 2004: (0.20, 0.015, 0.025),
107
103
  2023: (0.18, 0.01, 0.01),
108
104
  }[self.pub_year]
109
105
 
@@ -127,7 +123,7 @@ class GuidelinesThresholds:
127
123
 
128
124
  # imputed_presumption is relevant for presumptions implicating
129
125
  # mergers *to* symmetry in numbers-equivalent of post-merger HHI
130
- # as in 2010 U.S.Guidelines and 2004 EU Commission Guidelines
126
+ # as in 2010 U.S.Guidelines
131
127
  object.__setattr__(
132
128
  self,
133
129
  "imputed_presumption",
@@ -145,7 +141,7 @@ class GuidelinesThresholds:
145
141
  _cmcr,
146
142
  _ipr := _g,
147
143
  )
148
- if self.pub_year in (2004, 2010)
144
+ if self.pub_year == 2010
149
145
  else HMGThresholds(
150
146
  2 * (1 / (_fc + 1)) ** 2, _fc, _r, _g, _dr, _cmcr, _ipr
151
147
  )
@@ -238,7 +234,9 @@ class DiversionRatioBoundary:
238
234
  )
239
235
 
240
236
  recapture_ratio: float = field(
241
- kw_only=False, default=DEFAULT_REC_RATE, validator=validators.instance_of(float)
237
+ kw_only=False,
238
+ default=DEFAULT_REC_RATIO,
239
+ validator=validators.instance_of(float),
242
240
  )
243
241
 
244
242
  recapture_form: RECForm | None = field(kw_only=True, default=RECForm.INOUT)
@@ -368,7 +366,7 @@ def guppi_from_delta(
368
366
  /,
369
367
  *,
370
368
  m_star: float = 1.00,
371
- r_bar: float = DEFAULT_REC_RATE,
369
+ r_bar: float = DEFAULT_REC_RATIO,
372
370
  ) -> decimal.Decimal:
373
371
  """
374
372
  Translate ∆HHI bound to GUPPI bound.
@@ -395,13 +393,13 @@ def guppi_from_delta(
395
393
 
396
394
 
397
395
  def critical_share_ratio(
398
- _guppi_bound: float = 0.075,
396
+ _guppi_bound: float | decimal.Decimal = 0.075,
399
397
  /,
400
398
  *,
401
399
  m_star: float = 1.00,
402
400
  r_bar: float = 1.00,
403
401
  frac: float = 1e-16,
404
- ) -> MPFloat:
402
+ ) -> decimal.Decimal:
405
403
  """
406
404
  Corollary to GUPPI bound.
407
405
 
@@ -426,11 +424,11 @@ def critical_share_ratio(
426
424
 
427
425
 
428
426
  def share_from_guppi(
429
- _guppi_bound: float = 0.065,
427
+ _guppi_bound: float | decimal.Decimal = 0.065,
430
428
  /,
431
429
  *,
432
430
  m_star: float = 1.00,
433
- r_bar: float = DEFAULT_REC_RATE,
431
+ r_bar: float = DEFAULT_REC_RATIO,
434
432
  ) -> decimal.Decimal:
435
433
  """
436
434
  Symmetric-firm share for given GUPPI, margin, and recapture ratio.
@@ -5,7 +5,7 @@ from typing import Any, Literal, TypedDict
5
5
  import numpy as np
6
6
  from mpmath import mp, mpf # type: ignore
7
7
 
8
- from .. import DEFAULT_REC_RATE, VERSION, ArrayBIGINT, ArrayDouble # noqa: TID252
8
+ from .. import DEFAULT_REC_RATIO, VERSION, ArrayBIGINT, ArrayDouble # noqa: TID252
9
9
  from . import MPFloat
10
10
 
11
11
  __version__ = VERSION
@@ -34,7 +34,7 @@ class GuidelinesBoundary:
34
34
  """Area under the boundary."""
35
35
 
36
36
 
37
- def dh_area(_dh_val: float | MPFloat = 0.01, /, *, dps: int = 9) -> float:
37
+ def dh_area(_delta_bound: float | MPFloat = 0.01, /, *, dps: int = 9) -> float:
38
38
  R"""
39
39
  Area under the ΔHHI boundary.
40
40
 
@@ -55,7 +55,7 @@ def dh_area(_dh_val: float | MPFloat = 0.01, /, *, dps: int = 9) -> float:
55
55
 
56
56
  Parameters
57
57
  ----------
58
- _dh_val
58
+ _delta_bound
59
59
  Change in concentration.
60
60
  dps
61
61
  Specified precision in decimal places.
@@ -66,22 +66,26 @@ def dh_area(_dh_val: float | MPFloat = 0.01, /, *, dps: int = 9) -> float:
66
66
 
67
67
  """
68
68
 
69
- _dh_val = mpf(f"{_dh_val}")
70
- _s_naught = (1 - mp.sqrt(1 - 2 * _dh_val)) / 2
69
+ _delta_bound = mpf(f"{_delta_bound}")
70
+ _s_naught = (1 - mp.sqrt(1 - 2 * _delta_bound)) / 2
71
71
 
72
72
  return round(
73
- float(_s_naught + (_dh_val / 2) * (mp.ln(1 - _s_naught) - mp.ln(_s_naught))),
73
+ float(
74
+ _s_naught + (_delta_bound / 2) * (mp.ln(1 - _s_naught) - mp.ln(_s_naught))
75
+ ),
74
76
  dps,
75
77
  )
76
78
 
77
79
 
78
- def hhi_delta_boundary(_dh_val: float = 0.01, /, *, dps: int = 5) -> GuidelinesBoundary:
80
+ def hhi_delta_boundary(
81
+ _delta_bound: float | decimal.Decimal | MPFloat = 0.01, /, *, dps: int = 5
82
+ ) -> GuidelinesBoundary:
79
83
  """
80
84
  Generate the list of share combination on the ΔHHI boundary.
81
85
 
82
86
  Parameters
83
87
  ----------
84
- _dh_val:
88
+ _delta_bound:
85
89
  Merging-firms' ΔHHI bound.
86
90
  dps
87
91
  Number of decimal places for rounding reported shares.
@@ -92,33 +96,32 @@ def hhi_delta_boundary(_dh_val: float = 0.01, /, *, dps: int = 5) -> GuidelinesB
92
96
 
93
97
  """
94
98
 
95
- _dh_val = mpf(f"{_dh_val}")
96
- _s_naught = 1 / 2 * (1 - mp.sqrt(1 - 2 * _dh_val))
97
- _s_mid = mp.sqrt(_dh_val / 2)
99
+ _delta_bound = mpf(f"{_delta_bound}")
100
+ _s_naught = 1 / 2 * (1 - mp.sqrt(1 - 2 * _delta_bound))
101
+ _s_mid = mp.sqrt(_delta_bound / 2)
98
102
 
99
103
  _dh_step_sz = mp.power(10, -6)
100
104
  _s_1 = np.array(mp.arange(_s_mid, _s_naught - mp.eps, -_dh_step_sz))
101
- _s_2 = _dh_val / (2 * _s_1)
102
105
 
103
106
  # Boundary points
104
107
  _dh_half = np.vstack((
105
- np.column_stack((_s_1, _s_2)).astype(np.float64),
108
+ np.column_stack((_s_1, _delta_bound / (2 * _s_1))).astype(np.float64),
106
109
  np.array([(mpf("0.0"), mpf("1.0"))], np.float64),
107
110
  ))
108
111
  _dh_bdry_pts = np.vstack((_dh_half[::-1], _dh_half[1:, ::-1]))
109
112
 
110
- return GuidelinesBoundary(_dh_bdry_pts, dh_area(_dh_val, dps=dps))
113
+ return GuidelinesBoundary(_dh_bdry_pts, dh_area(_delta_bound, dps=dps))
111
114
 
112
115
 
113
116
  def hhi_pre_contrib_boundary(
114
- _hhi_contrib: float = 0.03125, /, *, dps: int = 5
117
+ _hhi_bound: float | decimal.Decimal | MPFloat = 0.03125, /, *, dps: int = 5
115
118
  ) -> GuidelinesBoundary:
116
119
  """
117
120
  Share combinations on the premerger HHI contribution boundary.
118
121
 
119
122
  Parameters
120
123
  ----------
121
- _hhi_contrib:
124
+ _hhi_bound:
122
125
  Merging-firms' pre-merger HHI contribution bound.
123
126
  dps
124
127
  Number of decimal places for rounding reported shares.
@@ -128,23 +131,23 @@ def hhi_pre_contrib_boundary(
128
131
  Array of share-pairs, area under boundary.
129
132
 
130
133
  """
131
- _hhi_contrib = mpf(f"{_hhi_contrib}")
132
- _s_mid = mp.sqrt(_hhi_contrib / 2)
134
+ _hhi_bound = mpf(f"{_hhi_bound}")
135
+ _s_mid = mp.sqrt(_hhi_bound / 2)
133
136
 
134
137
  _bdry_step_sz = mp.power(10, -dps)
135
138
  # Range-limit is 0 less a step, which is -1 * step-size
136
139
  _s_1 = np.array(mp.arange(_s_mid, -_bdry_step_sz, -_bdry_step_sz))
137
- _s_2 = np.sqrt(_hhi_contrib - _s_1**2)
140
+ _s_2 = np.sqrt(_hhi_bound - _s_1**2)
138
141
  _bdry_pts_mid = np.column_stack((_s_1, _s_2)).astype(np.float64)
139
142
 
140
143
  return GuidelinesBoundary(
141
144
  np.vstack((_bdry_pts_mid[::-1], _bdry_pts_mid[1:, ::-1])),
142
- round(float(mp.pi * _hhi_contrib / 4), dps),
145
+ round(float(mp.pi * _hhi_bound / 4), dps),
143
146
  )
144
147
 
145
148
 
146
149
  def combined_share_boundary(
147
- _s_intcpt: float = 0.0625, /, *, dps: int = 10
150
+ _s_intcpt: float | decimal.Decimal | MPFloat = 0.0625, /, *, dps: int = 10
148
151
  ) -> GuidelinesBoundary:
149
152
  """
150
153
  Share combinations on the merging-firms' combined share boundary.
@@ -168,18 +171,14 @@ def combined_share_boundary(
168
171
  _s_intcpt = mpf(f"{_s_intcpt}")
169
172
  _s_mid = _s_intcpt / 2
170
173
 
171
- _s1_pts = (0, _s_mid, _s_intcpt)
174
+ _s1_pts = np.array([0, _s_mid, _s_intcpt], np.float64)
172
175
  return GuidelinesBoundary(
173
- np.column_stack((
174
- np.array(_s1_pts, np.float64),
175
- np.array(_s1_pts[::-1], np.float64),
176
- )),
177
- round(float(_s_intcpt * _s_mid), dps),
176
+ np.column_stack((_s1_pts, _s1_pts[::-1])), round(float(_s_intcpt * _s_mid), dps)
178
177
  )
179
178
 
180
179
 
181
180
  def hhi_post_contrib_boundary(
182
- _hhi_contrib: float = 0.800, /, *, dps: int = 10
181
+ _hhi_bound: float | decimal.Decimal | MPFloat = 0.800, /, *, dps: int = 10
183
182
  ) -> GuidelinesBoundary:
184
183
  """
185
184
  Share combinations on the postmerger HHI contribution boundary.
@@ -189,7 +188,7 @@ def hhi_post_contrib_boundary(
189
188
 
190
189
  Parameters
191
190
  ----------
192
- _hhi_contrib:
191
+ _hhi_bound:
193
192
  Merging-firms' pre-merger HHI contribution bound.
194
193
  dps
195
194
  Number of decimal places for rounding reported shares.
@@ -199,12 +198,17 @@ def hhi_post_contrib_boundary(
199
198
  Array of share-pairs, area under boundary.
200
199
 
201
200
  """
202
- return combined_share_boundary(np.sqrt(_hhi_contrib), dps=dps)
201
+ return combined_share_boundary(
202
+ _hhi_bound.sqrt()
203
+ if isinstance(_hhi_bound, decimal.Decimal | mpf)
204
+ else np.sqrt(_hhi_bound),
205
+ dps=dps,
206
+ )
203
207
 
204
208
 
205
209
  def shrratio_boundary_wtd_avg(
206
- _delta_star: float = 0.075,
207
- _r_val: float = DEFAULT_REC_RATE,
210
+ _delta_star: float | decimal.Decimal | MPFloat = 0.075,
211
+ _r_val: float = DEFAULT_REC_RATIO,
208
212
  /,
209
213
  *,
210
214
  agg_method: Literal[
@@ -411,8 +415,8 @@ def shrratio_boundary_wtd_avg(
411
415
 
412
416
 
413
417
  def shrratio_boundary_xact_avg(
414
- _delta_star: float = 0.075,
415
- _r_val: float = DEFAULT_REC_RATE,
418
+ _delta_star: float | decimal.Decimal | MPFloat = 0.075,
419
+ _r_val: float = DEFAULT_REC_RATIO,
416
420
  /,
417
421
  *,
418
422
  recapture_form: Literal["inside-out", "proportional"] = "inside-out",
@@ -566,8 +570,8 @@ def shrratio_boundary_xact_avg(
566
570
 
567
571
 
568
572
  def shrratio_boundary_xact_avg_mp(
569
- _delta_star: float = 0.075,
570
- _r_val: float = DEFAULT_REC_RATE,
573
+ _delta_star: float | decimal.Decimal | MPFloat = 0.075,
574
+ _r_val: float = DEFAULT_REC_RATIO,
571
575
  /,
572
576
  *,
573
577
  recapture_form: Literal["inside-out", "proportional"] = "inside-out",
@@ -721,8 +725,8 @@ def shrratio_boundary_xact_avg_mp(
721
725
 
722
726
 
723
727
  def shrratio_boundary_min(
724
- _delta_star: float = 0.075,
725
- _r_val: float = DEFAULT_REC_RATE,
728
+ _delta_star: float | decimal.Decimal | MPFloat = 0.075,
729
+ _r_val: float = DEFAULT_REC_RATIO,
726
730
  /,
727
731
  *,
728
732
  recapture_form: str = "inside-out",
@@ -788,7 +792,11 @@ def shrratio_boundary_min(
788
792
 
789
793
 
790
794
  def shrratio_boundary_max(
791
- _delta_star: float = 0.075, _r_val: float = DEFAULT_REC_RATE, /, *, dps: int = 10
795
+ _delta_star: float | decimal.Decimal | MPFloat = 0.075,
796
+ _r_val: float = DEFAULT_REC_RATIO,
797
+ /,
798
+ *,
799
+ dps: int = 10,
792
800
  ) -> GuidelinesBoundary:
793
801
  """
794
802
  Share combinations on the minimum GUPPI boundary with symmetric
@@ -905,7 +913,7 @@ def lerp[LerpT: (float, MPFloat, ArrayDouble, ArrayBIGINT)](
905
913
 
906
914
 
907
915
  def round_cust(
908
- _num: float = 0.060215,
916
+ _num: float | decimal.Decimal | MPFloat = 0.060215,
909
917
  /,
910
918
  *,
911
919
  frac: float = 0.005,
@@ -952,7 +960,7 @@ def round_cust(
952
960
  ):
953
961
  raise ValueError(
954
962
  f"Value, {f'"{rounding_mode}"'} is invalid for rounding_mode."
955
- "Documentation for the, \"decimal\" built-in lists valid rounding modes."
963
+ 'Documentation for the, "decimal" built-in lists valid rounding modes.'
956
964
  )
957
965
 
958
966
  _n, _f, _e = (decimal.Decimal(f"{_g}") for _g in [_num, frac, 1])
@@ -16,7 +16,7 @@ from mpmath import mp, mpf # type: ignore
16
16
  from scipy.spatial.distance import minkowski as distance_function # type: ignore
17
17
  from sympy import lambdify, simplify, solve, symbols # type: ignore
18
18
 
19
- from .. import DEFAULT_REC_RATE, VERSION, ArrayDouble # noqa: TID252
19
+ from .. import DEFAULT_REC_RATIO, VERSION, ArrayDouble # noqa: TID252
20
20
  from . import guidelines_boundary_functions as gbfn
21
21
 
22
22
  __version__ = VERSION
@@ -101,7 +101,7 @@ def hhi_delta_boundary_qdtr(_dh_val: float = 0.01, /) -> GuidelinesBoundaryCalla
101
101
 
102
102
  def shrratio_boundary_qdtr_wtd_avg(
103
103
  _delta_star: float = 0.075,
104
- _r_val: float = DEFAULT_REC_RATE,
104
+ _r_val: float = DEFAULT_REC_RATIO,
105
105
  /,
106
106
  *,
107
107
  weighting: Literal["own-share", "cross-product-share"] | None = "own-share",
@@ -220,7 +220,7 @@ def shrratio_boundary_qdtr_wtd_avg(
220
220
 
221
221
  def shrratio_boundary_distance(
222
222
  _delta_star: float = 0.075,
223
- _r_val: float = DEFAULT_REC_RATE,
223
+ _r_val: float = DEFAULT_REC_RATIO,
224
224
  /,
225
225
  *,
226
226
  agg_method: Literal["arithmetic mean", "distance"] = "arithmetic mean",
@@ -15,7 +15,7 @@ from attrs import Attribute, cmp_using, field, frozen, validators
15
15
  from numpy.random import SeedSequence
16
16
 
17
17
  from .. import ( # noqa: TID252
18
- DEFAULT_REC_RATE,
18
+ DEFAULT_REC_RATIO,
19
19
  VERSION,
20
20
  ArrayBIGINT,
21
21
  ArrayBoolean,
@@ -183,7 +183,7 @@ class ShareSpec:
183
183
  recapture_form: RECForm = field(default=RECForm.INOUT)
184
184
  """See :class:`mergeron.RECForm`"""
185
185
 
186
- recapture_ratio: float | None = field(default=DEFAULT_REC_RATE)
186
+ recapture_ratio: float | None = field(default=DEFAULT_REC_RATIO)
187
187
  """A value between 0 and 1.
188
188
 
189
189
  :code:`None` if market share specification requires direct generation of
@@ -194,8 +194,7 @@ class ShareSpec:
194
194
  in published merger guidelines. Accordingly, the recapture ratio rounded to
195
195
  the nearest 5% is:
196
196
 
197
- * 0.85, **7-to-6 merger from symmetry**; US Guidelines, 1992, 2023
198
- * 0.80, **6-to-5 merger to symmetry**; EU Guidelines for horizontal mergers, 2004
197
+ * 0.85, **7-to-6 merger from symmetry**; US Guidelines, 1982, 1984, 1992, 2023
199
198
  * 0.80, 5-to-4 merger from symmetry
200
199
  * 0.80, **5-to-4 merger to symmetry**; US Guidelines, 2010
201
200
 
@@ -13,7 +13,7 @@ from attrs import Attribute, define, field, validators
13
13
  from joblib import Parallel, cpu_count, delayed # type: ignore
14
14
  from numpy.random import SeedSequence
15
15
 
16
- from .. import DEFAULT_REC_RATE, VERSION, RECForm # noqa: TID252 # noqa
16
+ from .. import DEFAULT_REC_RATIO, VERSION, RECForm # noqa: TID252 # noqa
17
17
  from ..core import guidelines_boundaries as gbl # noqa: TID252
18
18
  from ..core.guidelines_boundaries import HMGThresholds # noqa: TID252
19
19
  from . import (
@@ -74,7 +74,7 @@ class MarketSample:
74
74
  share_spec: ShareSpec = field(
75
75
  kw_only=True,
76
76
  default=ShareSpec(
77
- SHRDistribution.UNI, None, None, RECForm.INOUT, DEFAULT_REC_RATE
77
+ SHRDistribution.UNI, None, None, RECForm.INOUT, DEFAULT_REC_RATIO
78
78
  ),
79
79
  validator=validators.instance_of(ShareSpec),
80
80
  )
@@ -11,7 +11,7 @@ import numpy as np
11
11
  from attrs import evolve
12
12
  from numpy.random import SeedSequence
13
13
 
14
- from .. import DEFAULT_REC_RATE, VERSION, ArrayDouble, RECForm # noqa: TID252
14
+ from .. import DEFAULT_REC_RATIO, VERSION, ArrayDouble, RECForm # noqa: TID252
15
15
  from ..core.empirical_margin_distribution import mgn_data_resampler # noqa: TID252
16
16
  from ..core.pseudorandom_numbers import ( # noqa: TID252
17
17
  DEFAULT_DIST_PARMS,
@@ -100,7 +100,7 @@ def gen_share_data(
100
100
 
101
101
  # If recapture_form == "inside-out", recalculate _aggregate_purchase_prob
102
102
  _frmshr_array = _mkt_share_sample.mktshr_array[:, :2]
103
- _r_bar = _share_spec.recapture_ratio or DEFAULT_REC_RATE
103
+ _r_bar = _share_spec.recapture_ratio or DEFAULT_REC_RATIO
104
104
  if _recapture_form == RECForm.INOUT:
105
105
  _mkt_share_sample = ShareDataSample(
106
106
  _mkt_share_sample.mktshr_array,
@@ -266,7 +266,7 @@ def gen_market_shares_dirichlet_multimarket(
266
266
  else:
267
267
 
268
268
  def _gen_dir_alphas(_fcv: int) -> ArrayDouble:
269
- return np.array(_dir_alphas_full[:_fcv], dtype=np.float64) # type: ignore
269
+ return np.array(_dir_alphas_full[:_fcv], dtype=np.float64)
270
270
 
271
271
  _fcounts = prng(_fcount_rng_seed_seq).choice(
272
272
  _fcount_keys, size=(_s_size, 1), p=_choice_wts
@@ -604,8 +604,7 @@ def gen_margin_price_data(
604
604
  del _price_array_here
605
605
  case _:
606
606
  raise ValueError(
607
- f"Specitication of price distribution"
608
- f' "{_price_spec.value}" is invalid.'
607
+ f'Specification of price distribution, "{_price_spec.value}" is invalid.'
609
608
  )
610
609
  if _price_spec != PriceSpec.CSY:
611
610
  _margin_data = _gen_margin_data(
@@ -373,7 +373,7 @@ def save_array_to_hdf5(
373
373
  *,
374
374
  saved_array_name_suffix: str | None = None,
375
375
  ) -> None:
376
- _h5_array_name = f"{_array_name}_{saved_array_name_suffix or ""}".rstrip("_")
376
+ _h5_array_name = f"{_array_name}_{saved_array_name_suffix or ''}".rstrip("_")
377
377
 
378
378
  with suppress(ptb.NoSuchNodeError):
379
379
  _h5_file.remove_node(_h5_group, name=_array_name)
@@ -1,16 +0,0 @@
1
- mergeron
2
- ========
3
-
4
- Copyright 2017-2024 S. Murthy Kambhampaty
5
-
6
- MIT License
7
- -----------
8
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11
-
12
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13
-
14
- Exceptions
15
- ----------
16
- Modules provided in the mergeron.ext subpackage are redistributed under the license published within each module.