mergeron 2024.739145.4__py3-none-any.whl → 2024.739145.5__py3-none-any.whl
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.
- mergeron/__init__.py +2 -2
- mergeron/core/guidelines_boundaries.py +21 -23
- mergeron/core/guidelines_boundary_functions.py +49 -41
- mergeron/core/guidelines_boundary_functions_extra.py +3 -3
- mergeron/gen/__init__.py +3 -4
- mergeron/gen/data_generation.py +2 -2
- mergeron/gen/data_generation_functions.py +4 -5
- mergeron/gen/upp_tests.py +1 -1
- {mergeron-2024.739145.4.dist-info → mergeron-2024.739145.5.dist-info}/METADATA +2 -1
- {mergeron-2024.739145.4.dist-info → mergeron-2024.739145.5.dist-info}/RECORD +11 -12
- {mergeron-2024.739145.4.dist-info → mergeron-2024.739145.5.dist-info}/WHEEL +1 -1
- mergeron/License.txt +0 -16
mergeron/__init__.py
CHANGED
|
@@ -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.
|
|
11
|
+
VERSION = "2024.739145.5"
|
|
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
|
-
|
|
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
|
-
|
|
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[
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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,
|
|
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 =
|
|
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
|
-
) ->
|
|
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 =
|
|
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
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
70
|
-
_s_naught = (1 - mp.sqrt(1 - 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(
|
|
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(
|
|
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
|
-
|
|
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
|
-
|
|
96
|
-
_s_naught = 1 / 2 * (1 - mp.sqrt(1 - 2 *
|
|
97
|
-
_s_mid = mp.sqrt(
|
|
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,
|
|
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(
|
|
113
|
+
return GuidelinesBoundary(_dh_bdry_pts, dh_area(_delta_bound, dps=dps))
|
|
111
114
|
|
|
112
115
|
|
|
113
116
|
def hhi_pre_contrib_boundary(
|
|
114
|
-
|
|
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
|
-
|
|
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
|
-
|
|
132
|
-
_s_mid = mp.sqrt(
|
|
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(
|
|
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 *
|
|
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
|
-
|
|
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
|
-
|
|
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(
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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
|
-
|
|
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
|
|
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 =
|
|
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 =
|
|
223
|
+
_r_val: float = DEFAULT_REC_RATIO,
|
|
224
224
|
/,
|
|
225
225
|
*,
|
|
226
226
|
agg_method: Literal["arithmetic mean", "distance"] = "arithmetic mean",
|
mergeron/gen/__init__.py
CHANGED
|
@@ -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
|
-
|
|
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=
|
|
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
|
|
mergeron/gen/data_generation.py
CHANGED
|
@@ -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
|
|
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,
|
|
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
|
|
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
|
|
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)
|
|
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
|
|
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(
|
mergeron/gen/upp_tests.py
CHANGED
|
@@ -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
|
|
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,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mergeron
|
|
3
|
-
Version: 2024.739145.
|
|
3
|
+
Version: 2024.739145.5
|
|
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)
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
mergeron/
|
|
2
|
-
mergeron/__init__.py,sha256=MokASoHjOHr1txbxGX5QIRxR2N6YH4UUEweIEMTBzDY,1476
|
|
1
|
+
mergeron/__init__.py,sha256=AC6G15BvvMrueNoem4otWbhncZEtc8FnLfDcm2LoNOE,1477
|
|
3
2
|
mergeron/core/__init__.py,sha256=jPGd0okmvNOdWnTu4biR4hqnL29IERaY4Olv8mS02ko,188
|
|
4
3
|
mergeron/core/empirical_margin_distribution.py,sha256=iU72c6rPwqduH8GlvES1na2uvw5qXq0IQfsTWnL_ueQ,8726
|
|
5
4
|
mergeron/core/ftc_merger_investigations_data.py,sha256=_Qno1_oWcHmDd60j8YX6BLUSLeAn-DU6KpvMOcbCIaE,28728
|
|
6
|
-
mergeron/core/guidelines_boundaries.py,sha256=
|
|
7
|
-
mergeron/core/guidelines_boundary_functions.py,sha256=
|
|
8
|
-
mergeron/core/guidelines_boundary_functions_extra.py,sha256=
|
|
5
|
+
mergeron/core/guidelines_boundaries.py,sha256=uKRIwTrGXKf8CbabjjqRcMO4wGvtAUrd2MrMICzgNvg,15336
|
|
6
|
+
mergeron/core/guidelines_boundary_functions.py,sha256=SoTamDsKrThqDfoNTHeGp2ntiwhzscWmkAbIWrBtUq4,34885
|
|
7
|
+
mergeron/core/guidelines_boundary_functions_extra.py,sha256=ytTWxYk7FkGLQubkQXrniwP_2ZlYssp4rmOxy4_7480,11292
|
|
9
8
|
mergeron/core/pseudorandom_numbers.py,sha256=ps5H3n7jC5iJq_ulrmGvTAFmMeNXq-7IPWQQog7q5TY,9225
|
|
10
9
|
mergeron/data/__init__.py,sha256=KtjBlZOl7jwBCAUhrTJB9PdrN39YLYytNiSUSM_gRmA,62
|
|
11
10
|
mergeron/data/damodaran_margin_data.xls,sha256=Qggl1p5nkOMJI8YUXhkwXQRz-OhRSqBTzz57N0JQyYA,79360
|
|
@@ -13,12 +12,12 @@ mergeron/data/damodaran_margin_data_dict.msgpack,sha256=sr6s4L69kposEpzGI7jpPb4U
|
|
|
13
12
|
mergeron/data/ftc_invdata.msgpack,sha256=WBFHgi7Ld4R-h2zL2Zc3TOIlKqVrbVFMH1LoI4-T-M0,264664
|
|
14
13
|
mergeron/demo/__init__.py,sha256=KtjBlZOl7jwBCAUhrTJB9PdrN39YLYytNiSUSM_gRmA,62
|
|
15
14
|
mergeron/demo/visualize_empirical_margin_distribution.py,sha256=_1SWKqFJNqKV_yA3v2tmzl8Th3CC3SXpb6VGiwGGuN0,2373
|
|
16
|
-
mergeron/gen/__init__.py,sha256=
|
|
17
|
-
mergeron/gen/data_generation.py,sha256=
|
|
18
|
-
mergeron/gen/data_generation_functions.py,sha256=
|
|
15
|
+
mergeron/gen/__init__.py,sha256=6A1HVewEEwLo4JtZZ61ShzhU2phEeNfTxmTPlpi5LXY,17215
|
|
16
|
+
mergeron/gen/data_generation.py,sha256=nzCWVJBXYxloR6J6MamFM0MUbDzguhARCAEksYkX1Dw,16872
|
|
17
|
+
mergeron/gen/data_generation_functions.py,sha256=QmM89KzDP-8hz4ibjWDiEn_KVulgUN_be19j-P9LdWU,28944
|
|
19
18
|
mergeron/gen/enforcement_stats.py,sha256=ZjrV_VkFMF0D1myc-fj-W99M1EhJMA9-nCfyE5g9e54,10890
|
|
20
|
-
mergeron/gen/upp_tests.py,sha256=
|
|
19
|
+
mergeron/gen/upp_tests.py,sha256=vv9gBHQzabYxgcOBofTPHuNael8SbUAMfNW9c2H2C84,12548
|
|
21
20
|
mergeron/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
22
|
-
mergeron-2024.739145.
|
|
23
|
-
mergeron-2024.739145.
|
|
24
|
-
mergeron-2024.739145.
|
|
21
|
+
mergeron-2024.739145.5.dist-info/METADATA,sha256=_Ywnp2xKUSmbtRB4pTG3N4VrHaKOXSI-9lKU0gIB4HE,14483
|
|
22
|
+
mergeron-2024.739145.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
23
|
+
mergeron-2024.739145.5.dist-info/RECORD,,
|
mergeron/License.txt
DELETED
|
@@ -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.
|