mergeron 2024.738949.5__py3-none-any.whl → 2024.738949.6__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 +29 -0
- mergeron/core/__init__.py +65 -1
- mergeron/core/excel_helper.py +5 -12
- mergeron/core/guidelines_boundaries.py +116 -537
- mergeron/core/guidelines_boundaries_specialized_functions.py +341 -0
- mergeron/core/pseudorandom_numbers.py +1 -1
- mergeron/examples/concentration_as_diversion.py +45 -50
- mergeron/examples/enforcement_boundaries_for_mergers_with_asymmetric_shares.py +13 -7
- mergeron/examples/investigations_stats_obs_tables.py +13 -11
- mergeron/examples/investigations_stats_sim_tables.py +11 -12
- mergeron/examples/plotSafeHarbs_symbolically.py +7 -5
- mergeron/examples/sound_guppi_safeharbor.py +6 -7
- mergeron/examples/visualize_guidelines_tests.py +3 -5
- mergeron/gen/__init__.py +9 -33
- mergeron/gen/_data_generation_functions_nonpublic.py +5 -6
- mergeron/gen/data_generation.py +1 -2
- mergeron/gen/upp_tests.py +7 -7
- {mergeron-2024.738949.5.dist-info → mergeron-2024.738949.6.dist-info}/METADATA +1 -1
- {mergeron-2024.738949.5.dist-info → mergeron-2024.738949.6.dist-info}/RECORD +20 -19
- {mergeron-2024.738949.5.dist-info → mergeron-2024.738949.6.dist-info}/WHEEL +0 -0
|
@@ -26,7 +26,7 @@ INVDATA_DOTTEX_FORMAT_STR = "{}.tex".format(
|
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
def invres_stats_odds_ratio_byhhianddelta(
|
|
29
|
-
_data_array_dict: Mapping,
|
|
29
|
+
_data_array_dict: Mapping[str, Mapping[str, Mapping[str, fid.INVData]]],
|
|
30
30
|
_data_periods: tuple[str, str],
|
|
31
31
|
_merger_classes: Sequence[isl.INDGRPConstants | isl.EVIDENConstants],
|
|
32
32
|
/,
|
|
@@ -67,7 +67,9 @@ def invres_stats_odds_ratio_byhhianddelta(
|
|
|
67
67
|
for _data_period in _data_periods:
|
|
68
68
|
_data_array_dict_sub = _data_array_dict[_data_period][f"{_stats_group}"]
|
|
69
69
|
_table_no = isl.table_no_lku(
|
|
70
|
-
_data_array_dict_sub,
|
|
70
|
+
_data_array_dict_sub, # type: ignore
|
|
71
|
+
_table_ind_group,
|
|
72
|
+
_table_evid_cond,
|
|
71
73
|
)
|
|
72
74
|
|
|
73
75
|
_invres_rate_table_content.table_ref = _table_no
|
|
@@ -109,14 +111,14 @@ def invres_stats_odds_ratio_byhhianddelta(
|
|
|
109
111
|
_invres_rate_table_content.obs_merger_class = f"{_merger_class}"
|
|
110
112
|
_invres_rate_table_content.obs_period = _data_period.split("-")
|
|
111
113
|
|
|
112
|
-
_invres_cnts_array = _data_array_dict_sub[_table_no][-1]
|
|
114
|
+
_invres_cnts_array = _data_array_dict_sub[_table_no][-1] # type: ignore
|
|
113
115
|
_odds_ratio_data_str = ""
|
|
114
|
-
for _hhi_range_it in unique(_invres_cnts_array[:, 0]):
|
|
116
|
+
for _hhi_range_it in unique(_invres_cnts_array[:, 0]): # type: ignore
|
|
115
117
|
_invres_cnts_row_for_hhi_range = _invres_cnts_array[
|
|
116
118
|
_invres_cnts_array[:, 0] == _hhi_range_it
|
|
117
|
-
][:, 2:]
|
|
119
|
+
][:, 2:] # type: ignore
|
|
118
120
|
_odds_ratio_data_str += " & ".join([
|
|
119
|
-
INVRES_RATIO_FORMAT_STR.format(*g)
|
|
121
|
+
INVRES_RATIO_FORMAT_STR.format(*g) # type: ignore
|
|
120
122
|
for g in _invres_cnts_row_for_hhi_range
|
|
121
123
|
])
|
|
122
124
|
_odds_ratio_data_str += " & {}".format(
|
|
@@ -241,7 +243,7 @@ def invres_stats_obs_setup(
|
|
|
241
243
|
_stats_group_dict[_stats_group_key],
|
|
242
244
|
_invres_spec,
|
|
243
245
|
)
|
|
244
|
-
_output_dottex_pathlist += (_output_dottex_path,)
|
|
246
|
+
_output_dottex_pathlist += (_output_dottex_path,) # type: ignore
|
|
245
247
|
|
|
246
248
|
return _output_dottex_pathlist
|
|
247
249
|
|
|
@@ -252,7 +254,7 @@ def _invres_stats_obs_render(
|
|
|
252
254
|
_merger_classes: Sequence[isl.INDGRPConstants | isl.EVIDENConstants],
|
|
253
255
|
_stats_group: isl.StatsGrpSelector,
|
|
254
256
|
_stats_group_dict: Mapping,
|
|
255
|
-
_invres_spec: isl.INVResolution =
|
|
257
|
+
_invres_spec: isl.INVResolution = INVResolution.CLRN,
|
|
256
258
|
/,
|
|
257
259
|
) -> str:
|
|
258
260
|
_invres_rate_table_content = isl.StatsContainer()
|
|
@@ -416,12 +418,12 @@ def _invres_stats_obs_render(
|
|
|
416
418
|
|
|
417
419
|
|
|
418
420
|
def get_table_nos(
|
|
419
|
-
_data_array_dict: Mapping,
|
|
421
|
+
_data_array_dict: Mapping[str, fid.INVData],
|
|
420
422
|
_merger_classes: Sequence[isl.INDGRPConstants | isl.EVIDENConstants],
|
|
421
423
|
_stats_group: isl.StatsGrpSelector,
|
|
422
424
|
_data_period: str,
|
|
423
425
|
/,
|
|
424
|
-
) -> list:
|
|
426
|
+
) -> list[str]:
|
|
425
427
|
_stats_group_major = (
|
|
426
428
|
"ByFirmCount" if _stats_group == isl.StatsGrpSelector.FC else "ByHHIandDelta"
|
|
427
429
|
)
|
|
@@ -460,7 +462,7 @@ if __name__ == "__main__":
|
|
|
460
462
|
isl.EVIDENConstants.ED,
|
|
461
463
|
) # clstl.INDGRPConstants.IID)
|
|
462
464
|
data_periods = ("1996-2003", "2004-2011")
|
|
463
|
-
test_regime =
|
|
465
|
+
test_regime = INVResolution.ENFT
|
|
464
466
|
|
|
465
467
|
# Now generate the various tables summarizing merger investigations data
|
|
466
468
|
invres_stats_byhhianddelta_pathlist = invres_stats_odds_ratio_byhhianddelta(
|
|
@@ -18,20 +18,19 @@ from attrs import evolve
|
|
|
18
18
|
|
|
19
19
|
import mergeron.core.ftc_merger_investigations_data as fid
|
|
20
20
|
import mergeron.core.guidelines_boundaries as gbl
|
|
21
|
-
import mergeron.gen.data_generation as dgl
|
|
22
21
|
import mergeron.gen.investigations_stats as isl
|
|
23
22
|
import mergeron.gen.upp_tests as utl
|
|
24
|
-
from mergeron import DATA_DIR
|
|
23
|
+
from mergeron import DATA_DIR, RECConstants, UPPAggrSelector
|
|
25
24
|
from mergeron.core.proportions_tests import propn_ci
|
|
26
25
|
from mergeron.gen import (
|
|
26
|
+
FM2Constants,
|
|
27
27
|
INVResolution,
|
|
28
28
|
MarketSampleSpec,
|
|
29
29
|
PCMConstants,
|
|
30
30
|
PCMSpec,
|
|
31
|
-
RECConstants,
|
|
32
31
|
ShareSpec,
|
|
33
32
|
SHRConstants,
|
|
34
|
-
|
|
33
|
+
SSZConstants,
|
|
35
34
|
UPPTestRegime,
|
|
36
35
|
)
|
|
37
36
|
|
|
@@ -70,7 +69,7 @@ def invres_stats_sim_setup(
|
|
|
70
69
|
}
|
|
71
70
|
_sim_test_regime = _invres_stats_kwargs.get("sim_test_regime")
|
|
72
71
|
|
|
73
|
-
_invres_spec,
|
|
72
|
+
_invres_spec, _guppi_weighting, _divr_weighting = (
|
|
74
73
|
getattr(_sim_test_regime, _f.name)
|
|
75
74
|
for _f in fields(_sim_test_regime) # type: ignore
|
|
76
75
|
)
|
|
@@ -246,7 +245,7 @@ def invres_stats_sim_render(
|
|
|
246
245
|
R"and an estimated clearance rate of, for example, 50.0\%,",
|
|
247
246
|
Rf"the margin of error (m.o.e.) is {isl.moe_tmpl.render(rv=_stats_sim_ci_eg)}."
|
|
248
247
|
R"The m.o.e. is derived from the",
|
|
249
|
-
R"Clopper-Pearson exact 95\% confidence interval, {}.".format(
|
|
248
|
+
R"Clopper-Pearson exact 95\% confidence interval, {}.".format( # noqa: UP032
|
|
250
249
|
isl.ci_format_str.format(*_stats_sim_ci_eg).strip()
|
|
251
250
|
),
|
|
252
251
|
R"(The m.o.e. for simulated clearance rates varies",
|
|
@@ -379,8 +378,8 @@ if __name__ == "__main__":
|
|
|
379
378
|
pcm_dist_type, pcm_dist_parms = PCMConstants.EMPR, None
|
|
380
379
|
|
|
381
380
|
sim_test_regime = (
|
|
382
|
-
UPPTestRegime(INVResolution.CLRN,
|
|
383
|
-
UPPTestRegime(INVResolution.ENFT,
|
|
381
|
+
UPPTestRegime(INVResolution.CLRN, UPPAggrSelector.MAX, None),
|
|
382
|
+
UPPTestRegime(INVResolution.ENFT, UPPAggrSelector.OSD, None),
|
|
384
383
|
)[1]
|
|
385
384
|
invres_stats_kwargs = {"sim_test_regime": sim_test_regime}
|
|
386
385
|
|
|
@@ -403,11 +402,11 @@ if __name__ == "__main__":
|
|
|
403
402
|
else gbl.GuidelinesThresholds(1992).presumption
|
|
404
403
|
)
|
|
405
404
|
|
|
406
|
-
mkt_sample_spec =
|
|
405
|
+
mkt_sample_spec = MarketSampleSpec(
|
|
407
406
|
sample_sz_base,
|
|
408
407
|
invres_parm_vec.rec,
|
|
409
|
-
pcm_spec=PCMSpec(pcm_dist_type,
|
|
410
|
-
hsr_filing_test_type=
|
|
408
|
+
pcm_spec=PCMSpec(pcm_dist_type, FM2Constants.MNL, pcm_dist_parms),
|
|
409
|
+
hsr_filing_test_type=SSZConstants.HSR_NTH,
|
|
411
410
|
)
|
|
412
411
|
|
|
413
412
|
table_dottex_name = invres_stats_sim_setup(
|
|
@@ -418,7 +417,7 @@ if __name__ == "__main__":
|
|
|
418
417
|
mkt_sample_spec,
|
|
419
418
|
invres_stats_kwargs, # type: ignore
|
|
420
419
|
)
|
|
421
|
-
table_dottex_namelist += (table_dottex_name,)
|
|
420
|
+
table_dottex_namelist += (table_dottex_name,) # type: ignore
|
|
422
421
|
|
|
423
422
|
isl.render_table_pdf(
|
|
424
423
|
table_dottex_namelist,
|
|
@@ -11,20 +11,22 @@ from sympy import solve, symbols
|
|
|
11
11
|
from sympy.plotting import plot as symplot
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
def plot_safeharb_boundaries(
|
|
14
|
+
def plot_safeharb_boundaries(
|
|
15
|
+
_g_bar: float, _r_bar: float, _m_vals: Sequence[float]
|
|
16
|
+
) -> None:
|
|
15
17
|
s1, s2, rbar, delta_star = symbols(r"s1 s2 \overline{r} \delta^*", real=True)
|
|
16
18
|
|
|
17
19
|
for _m_val in _m_vals:
|
|
18
20
|
s_m = round((dstar_val := _g_bar / (_r_bar * _m_val)) / (1 + dstar_val), 3)
|
|
19
21
|
|
|
20
22
|
# Own-share-weighted average GUPPI, "inside-out" recapture
|
|
21
|
-
s2_sol = solve(
|
|
23
|
+
s2_sol = solve( # type: ignore
|
|
22
24
|
s1 * s2 / (1 - s1)
|
|
23
25
|
+ s2 * s1 / (1 - s2 * _r_bar - s1 * (1 - _r_bar))
|
|
24
26
|
- (s1 + s2) * delta_star,
|
|
25
27
|
s2,
|
|
26
28
|
)
|
|
27
|
-
symplot(
|
|
29
|
+
symplot( # type: ignore
|
|
28
30
|
s2_sol[0].subs({delta_star: dstar_val}),
|
|
29
31
|
(s1, 0, s_m),
|
|
30
32
|
ylabel=s2,
|
|
@@ -34,10 +36,10 @@ def plot_safeharb_boundaries(_g_bar: float, _r_bar: float, _m_vals: Sequence):
|
|
|
34
36
|
)
|
|
35
37
|
|
|
36
38
|
# Cross-product-share-weighted average GUPPI, proportional recapture
|
|
37
|
-
s2_sol = solve(
|
|
39
|
+
s2_sol = solve( # type: ignore
|
|
38
40
|
s2 * s2 / (1 - s1) + s1 * s1 / (1 - s2) - delta_star * (s1 + s2), s2
|
|
39
41
|
)
|
|
40
|
-
symplot(
|
|
42
|
+
symplot( # type: ignore
|
|
41
43
|
s2_sol[1].subs({delta_star: dstar_val}),
|
|
42
44
|
(s1, 0, s_m),
|
|
43
45
|
ylabel=s2,
|
|
@@ -6,19 +6,18 @@ from typing import Literal
|
|
|
6
6
|
import numpy as np
|
|
7
7
|
|
|
8
8
|
import mergeron.core.guidelines_boundaries as gbl
|
|
9
|
-
import mergeron.gen.data_generation as dgl
|
|
10
9
|
import mergeron.gen.investigations_stats as isl
|
|
11
10
|
import mergeron.gen.upp_tests as utl
|
|
12
|
-
from mergeron import DATA_DIR
|
|
11
|
+
from mergeron import DATA_DIR, RECConstants, UPPAggrSelector
|
|
13
12
|
from mergeron.core.pseudorandom_numbers import DIST_PARMS_DEFAULT
|
|
14
13
|
from mergeron.gen import (
|
|
14
|
+
FM2Constants,
|
|
15
15
|
INVResolution,
|
|
16
16
|
MarketSampleSpec,
|
|
17
17
|
PCMConstants,
|
|
18
18
|
PCMSpec,
|
|
19
19
|
ShareSpec,
|
|
20
20
|
SHRConstants,
|
|
21
|
-
UPPAggrSelector,
|
|
22
21
|
UPPTestRegime,
|
|
23
22
|
)
|
|
24
23
|
|
|
@@ -62,7 +61,7 @@ def analyze_invres_data(
|
|
|
62
61
|
_save_data_to_file: utl.SaveData = False
|
|
63
62
|
if save_data_to_file_flag:
|
|
64
63
|
_h5_path = DATA_DIR / PROG_PATH.with_suffix(".h5").name
|
|
65
|
-
(_, _h5_file, _h5_group), _h5_subgroup_name = utl.initialize_hd5(
|
|
64
|
+
(_, _h5_file, _h5_group), _h5_subgroup_name = utl.initialize_hd5( # type: ignore
|
|
66
65
|
_h5_path, _hmg_pub_year, _test_regime
|
|
67
66
|
) # type: ignore
|
|
68
67
|
|
|
@@ -76,7 +75,7 @@ def analyze_invres_data(
|
|
|
76
75
|
# with asymmetric margins
|
|
77
76
|
# ##
|
|
78
77
|
for _recapture_spec_test, _pcm_dist_test, _pcm_dist_firm2_test in iterprod(
|
|
79
|
-
(
|
|
78
|
+
(RECConstants.INOUT, RECConstants.FIXED),
|
|
80
79
|
[
|
|
81
80
|
tuple(
|
|
82
81
|
zip(
|
|
@@ -91,7 +90,7 @@ def analyze_invres_data(
|
|
|
91
90
|
)[_s]
|
|
92
91
|
for _s in [0, 2]
|
|
93
92
|
],
|
|
94
|
-
(
|
|
93
|
+
(FM2Constants.IID, FM2Constants.MNL),
|
|
95
94
|
):
|
|
96
95
|
if _recapture_spec_test == "proportional" and (
|
|
97
96
|
_pcm_dist_test[0] != "Uniform" or _pcm_dist_firm2_test == "MNL-dep"
|
|
@@ -128,7 +127,7 @@ def analyze_invres_data(
|
|
|
128
127
|
if _save_data_to_file:
|
|
129
128
|
_h5_file.flush()
|
|
130
129
|
|
|
131
|
-
_h5_subgrp_name = "invres_rec{}_pcm{}_fm2res{}".format(
|
|
130
|
+
_h5_subgrp_name = "invres_rec{}_pcm{}_fm2res{}".format( # noqa: UP032
|
|
132
131
|
_recapture_spec_test.name,
|
|
133
132
|
_pcm_dist_type_test.name,
|
|
134
133
|
_pcm_dist_firm2_test.name,
|
|
@@ -23,16 +23,14 @@ from numpy.typing import NDArray
|
|
|
23
23
|
import mergeron.core.guidelines_boundaries as gbl
|
|
24
24
|
import mergeron.gen.data_generation as dgl
|
|
25
25
|
import mergeron.gen.upp_tests as utl
|
|
26
|
-
from mergeron import DATA_DIR
|
|
26
|
+
from mergeron import DATA_DIR, RECConstants, UPPAggrSelector
|
|
27
27
|
from mergeron.core.pseudorandom_numbers import DIST_PARMS_DEFAULT
|
|
28
28
|
from mergeron.gen import (
|
|
29
29
|
INVResolution,
|
|
30
30
|
MarketDataSample,
|
|
31
31
|
MarketSampleSpec,
|
|
32
|
-
RECConstants,
|
|
33
32
|
ShareSpec,
|
|
34
33
|
SHRConstants,
|
|
35
|
-
UPPAggrSelector,
|
|
36
34
|
UPPTestRegime,
|
|
37
35
|
)
|
|
38
36
|
|
|
@@ -280,9 +278,9 @@ if __name__ == "__main__":
|
|
|
280
278
|
save_data_to_file_flag = True
|
|
281
279
|
if save_data_to_file_flag:
|
|
282
280
|
h5_path = DATA_DIR / PROG_PATH.with_suffix(".h5").name
|
|
283
|
-
(_, h5_file, h5_group), h5_subgroup_name = utl.initialize_hd5(
|
|
281
|
+
(_, h5_file, h5_group), h5_subgroup_name = utl.initialize_hd5( # type: ignore
|
|
284
282
|
h5_path, hmg_pub_year, test_regime
|
|
285
|
-
)
|
|
283
|
+
)
|
|
286
284
|
|
|
287
285
|
h5_subgroup = h5_file.create_group(
|
|
288
286
|
h5_group,
|
mergeron/gen/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@ from __future__ import annotations
|
|
|
7
7
|
|
|
8
8
|
from importlib.metadata import version
|
|
9
9
|
|
|
10
|
-
from .. import _PKG_NAME # noqa: TID252
|
|
10
|
+
from .. import _PKG_NAME, RECConstants, UPPAggrSelector # noqa: TID252
|
|
11
11
|
|
|
12
12
|
__version__ = version(_PKG_NAME)
|
|
13
13
|
|
|
@@ -74,15 +74,6 @@ class SHRConstants(enum.StrEnum):
|
|
|
74
74
|
"""
|
|
75
75
|
|
|
76
76
|
|
|
77
|
-
@enum.unique
|
|
78
|
-
class RECConstants(enum.StrEnum):
|
|
79
|
-
"""Recapture rate - derivation methods."""
|
|
80
|
-
|
|
81
|
-
INOUT = "inside-out"
|
|
82
|
-
OUTIN = "outside-in"
|
|
83
|
-
FIXED = "proportional"
|
|
84
|
-
|
|
85
|
-
|
|
86
77
|
@define(slots=True, frozen=True)
|
|
87
78
|
class ShareSpec:
|
|
88
79
|
"""Market share specification
|
|
@@ -216,7 +207,7 @@ class SSZConstants(float, enum.ReprEnum):
|
|
|
216
207
|
|
|
217
208
|
# Validators for selected attributes of MarketSampleSpec
|
|
218
209
|
def _sample_size_validator(
|
|
219
|
-
_object: MarketSampleSpec, _attribute: Attribute, _value: int, /
|
|
210
|
+
_object: MarketSampleSpec, _attribute: Attribute[int], _value: int, /
|
|
220
211
|
) -> None:
|
|
221
212
|
if _value < 10**6:
|
|
222
213
|
raise ValueError(
|
|
@@ -225,7 +216,10 @@ def _sample_size_validator(
|
|
|
225
216
|
|
|
226
217
|
|
|
227
218
|
def _recapture_rate_validator(
|
|
228
|
-
_object: MarketSampleSpec,
|
|
219
|
+
_object: MarketSampleSpec,
|
|
220
|
+
_attribute: Attribute[float | None],
|
|
221
|
+
_value: float | None,
|
|
222
|
+
/,
|
|
229
223
|
) -> None:
|
|
230
224
|
if _value and not (0 < _value <= 1):
|
|
231
225
|
raise ValueError("Recapture rate must lie in the interval, [0, 1).")
|
|
@@ -238,7 +232,7 @@ def _recapture_rate_validator(
|
|
|
238
232
|
|
|
239
233
|
|
|
240
234
|
def _share_spec_validator(
|
|
241
|
-
_instance: MarketSampleSpec, _attribute: Attribute, _value: ShareSpec, /
|
|
235
|
+
_instance: MarketSampleSpec, _attribute: Attribute[ShareSpec], _value: ShareSpec, /
|
|
242
236
|
) -> None:
|
|
243
237
|
_r_bar = _instance.recapture_rate
|
|
244
238
|
if _value.dist_type == SHRConstants.UNI:
|
|
@@ -269,7 +263,7 @@ def _share_spec_validator(
|
|
|
269
263
|
|
|
270
264
|
|
|
271
265
|
def _pcm_spec_validator(
|
|
272
|
-
_instance: MarketSampleSpec, _attribute: Attribute, _value: PCMSpec, /
|
|
266
|
+
_instance: MarketSampleSpec, _attribute: Attribute[PCMSpec], _value: PCMSpec, /
|
|
273
267
|
) -> None:
|
|
274
268
|
if (
|
|
275
269
|
_instance.share_spec.recapture_spec == RECConstants.FIXED
|
|
@@ -313,8 +307,7 @@ class MarketSampleSpec:
|
|
|
313
307
|
"""sample size generated"""
|
|
314
308
|
|
|
315
309
|
recapture_rate: float | None = field(
|
|
316
|
-
default=None,
|
|
317
|
-
validator=(validators.instance_of(float | None), _recapture_rate_validator),
|
|
310
|
+
default=None, validator=_recapture_rate_validator
|
|
318
311
|
)
|
|
319
312
|
"""market recapture rate
|
|
320
313
|
|
|
@@ -358,23 +351,6 @@ class INVResolution(enum.StrEnum):
|
|
|
358
351
|
BOTH = "both"
|
|
359
352
|
|
|
360
353
|
|
|
361
|
-
@enum.unique
|
|
362
|
-
class UPPAggrSelector(enum.StrEnum):
|
|
363
|
-
"""
|
|
364
|
-
Aggregator selection for GUPPI and diversion ratio
|
|
365
|
-
|
|
366
|
-
"""
|
|
367
|
-
|
|
368
|
-
AVG = "average"
|
|
369
|
-
CPA = "cross-product-share-weighted average"
|
|
370
|
-
CPD = "cross-product-share-weighted distance"
|
|
371
|
-
DIS = "symmetrically-weighted distance"
|
|
372
|
-
MAX = "max"
|
|
373
|
-
MIN = "min"
|
|
374
|
-
OSA = "own-share-weighted average"
|
|
375
|
-
OSD = "own-share-weighted distance"
|
|
376
|
-
|
|
377
|
-
|
|
378
354
|
@define(slots=True, frozen=True)
|
|
379
355
|
class UPPTestRegime:
|
|
380
356
|
resolution: INVResolution = field( # type: ignore
|
|
@@ -11,7 +11,7 @@ import numpy as np
|
|
|
11
11
|
from numpy.random import SeedSequence
|
|
12
12
|
from numpy.typing import NDArray
|
|
13
13
|
|
|
14
|
-
from .. import _PKG_NAME # noqa: TID252
|
|
14
|
+
from .. import _PKG_NAME, RECConstants # noqa: TID252
|
|
15
15
|
from ..core.damodaran_margin_data import resample_mgn_data # noqa: TID252
|
|
16
16
|
from ..core.pseudorandom_numbers import ( # noqa: TID252
|
|
17
17
|
DIST_PARMS_DEFAULT,
|
|
@@ -27,7 +27,6 @@ from . import (
|
|
|
27
27
|
PCMConstants,
|
|
28
28
|
PriceDataSample,
|
|
29
29
|
PRIConstants,
|
|
30
|
-
RECConstants,
|
|
31
30
|
ShareDataSample,
|
|
32
31
|
SHRConstants,
|
|
33
32
|
SSZConstants,
|
|
@@ -139,8 +138,8 @@ def _gen_market_shares_uniform(
|
|
|
139
138
|
"""
|
|
140
139
|
|
|
141
140
|
_frmshr_array = np.empty((_s_size, 2), dtype=np.float64)
|
|
142
|
-
_dist_parms_mktshr: NDArray[np.floating] = (
|
|
143
|
-
DIST_PARMS_DEFAULT if _dist_parms_mktshr is None else _dist_parms_mktshr
|
|
141
|
+
_dist_parms_mktshr: NDArray[np.floating[TF]] = (
|
|
142
|
+
DIST_PARMS_DEFAULT if _dist_parms_mktshr is None else _dist_parms_mktshr # type: ignore
|
|
144
143
|
)
|
|
145
144
|
_mrng = MultithreadedRNG(
|
|
146
145
|
_frmshr_array,
|
|
@@ -218,7 +217,7 @@ def _gen_market_shares_dirichlet_multisample(
|
|
|
218
217
|
|
|
219
218
|
"""
|
|
220
219
|
|
|
221
|
-
_firm_count_wts: NDArray[np.floating] = (
|
|
220
|
+
_firm_count_wts: NDArray[np.floating[TF]] = (
|
|
222
221
|
FCOUNT_WTS_DEFAULT if _firm_count_wts is None else _firm_count_wts
|
|
223
222
|
)
|
|
224
223
|
|
|
@@ -254,7 +253,7 @@ def _gen_market_shares_dirichlet_multisample(
|
|
|
254
253
|
else:
|
|
255
254
|
|
|
256
255
|
def _gen_dir_alphas(_fcv: int) -> NDArray[np.float64]:
|
|
257
|
-
return np.array(_dir_alphas_full[:_fcv], dtype=np.float64)
|
|
256
|
+
return np.array(_dir_alphas_full[:_fcv], dtype=np.float64) # type: ignore
|
|
258
257
|
|
|
259
258
|
_fcounts = prng(_fcount_rng_seed_seq).choice(
|
|
260
259
|
_fcount_keys, size=(_s_size, 1), p=_choice_wts
|
mergeron/gen/data_generation.py
CHANGED
|
@@ -12,7 +12,7 @@ import numpy as np
|
|
|
12
12
|
from numpy.random import SeedSequence
|
|
13
13
|
from numpy.typing import NDArray
|
|
14
14
|
|
|
15
|
-
from .. import _PKG_NAME # noqa: TID252
|
|
15
|
+
from .. import _PKG_NAME, RECConstants # noqa: TID252
|
|
16
16
|
from . import (
|
|
17
17
|
EMPTY_ARRAY_DEFAULT,
|
|
18
18
|
TF,
|
|
@@ -20,7 +20,6 @@ from . import (
|
|
|
20
20
|
MarketDataSample,
|
|
21
21
|
MarketSampleSpec,
|
|
22
22
|
PRIConstants,
|
|
23
|
-
RECConstants,
|
|
24
23
|
SHRConstants,
|
|
25
24
|
SSZConstants,
|
|
26
25
|
)
|
mergeron/gen/upp_tests.py
CHANGED
|
@@ -19,7 +19,9 @@ from joblib import Parallel, cpu_count, delayed # type: ignore
|
|
|
19
19
|
from numpy.random import SeedSequence
|
|
20
20
|
from numpy.typing import NDArray
|
|
21
21
|
|
|
22
|
-
from
|
|
22
|
+
from mergeron.core.pseudorandom_numbers import TF, TI
|
|
23
|
+
|
|
24
|
+
from .. import _PKG_NAME, RECConstants, UPPAggrSelector # noqa: TID252
|
|
23
25
|
from ..core import guidelines_boundaries as gbl # noqa: TID252
|
|
24
26
|
from . import (
|
|
25
27
|
EMPTY_ARRAY_DEFAULT,
|
|
@@ -27,8 +29,6 @@ from . import (
|
|
|
27
29
|
INVResolution,
|
|
28
30
|
MarketDataSample,
|
|
29
31
|
MarketSampleSpec,
|
|
30
|
-
RECConstants,
|
|
31
|
-
UPPAggrSelector,
|
|
32
32
|
UPPTestRegime,
|
|
33
33
|
UPPTestsCounts,
|
|
34
34
|
UPPTestsRaw,
|
|
@@ -49,8 +49,8 @@ class IVNRESCntsArgs(TypedDict, total=False):
|
|
|
49
49
|
sim_test_regime: UPPTestRegime
|
|
50
50
|
saved_array_name_suffix: str
|
|
51
51
|
save_data_to_file: SaveData
|
|
52
|
-
seed_seq_list: SeedSequence
|
|
53
|
-
|
|
52
|
+
seed_seq_list: list[SeedSequence]
|
|
53
|
+
nthreads: int
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
def sim_invres_cnts_ll(
|
|
@@ -109,7 +109,7 @@ def sim_invres_cnts_ll(
|
|
|
109
109
|
if _k != "seed_seq_list"
|
|
110
110
|
}
|
|
111
111
|
else:
|
|
112
|
-
_sim_invres_cnts_ll_kwargs
|
|
112
|
+
_sim_invres_cnts_ll_kwargs = {}
|
|
113
113
|
|
|
114
114
|
_res_list = Parallel(n_jobs=_thread_count, prefer="threads")(
|
|
115
115
|
delayed(sim_invres_cnts)(
|
|
@@ -459,7 +459,7 @@ def save_data_to_hdf5(
|
|
|
459
459
|
|
|
460
460
|
|
|
461
461
|
def save_array_to_hdf5(
|
|
462
|
-
_array_obj: NDArray[np.floating | np.integer | np.bool_],
|
|
462
|
+
_array_obj: NDArray[np.floating[TF] | np.integer[TI] | np.bool_],
|
|
463
463
|
_array_name: str,
|
|
464
464
|
_h5_group: ptb.Group,
|
|
465
465
|
_h5_file: ptb.File,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mergeron
|
|
3
|
-
Version: 2024.738949.
|
|
3
|
+
Version: 2024.738949.6
|
|
4
4
|
Summary: Analysis of standards defined in Horizontal Merger Guidelines
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: merger policy analysis,merger guidelines,merger screening,policy presumptions,concentration standards,upward pricing pressure,GUPPI
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
mergeron/License.txt,sha256=csSkn4lgUmJ0VEw1KAFZ3a8q0L4XccUdJ6Jj6xSNNRY,1246
|
|
2
|
-
mergeron/__init__.py,sha256=
|
|
2
|
+
mergeron/__init__.py,sha256=6fyeQvMxYjxO3tYSMV-SiKNeTJXOEZ7cEI8tSJrsoro,1016
|
|
3
3
|
mergeron/core/InCommon RSA Server CA cert chain.pem,sha256=W8TqydgY8jphQ4fr6WMdT6jLwqFjHLpx8fFr3LXub4s,4292
|
|
4
|
-
mergeron/core/__init__.py,sha256=
|
|
4
|
+
mergeron/core/__init__.py,sha256=HK82lny68hf75RptAEvYcV7B0wpeM0qnluXBm1H2oMA,2144
|
|
5
5
|
mergeron/core/damodaran_margin_data.py,sha256=DHTQdFjuZ5Yl3Dbq0db0QR4FHUqJpZj4yi5zdUncLtg,8166
|
|
6
|
-
mergeron/core/excel_helper.py,sha256=
|
|
6
|
+
mergeron/core/excel_helper.py,sha256=j-dNz6WVIFIDCn3ldK_eenPr0Gn996zxbbm3SEjVpPM,7823
|
|
7
7
|
mergeron/core/ftc_merger_investigations_data.py,sha256=YYkgeF-b_2_Tk8dsy_4dMz5QpV5UQEr7tB9ORiqKmww,26760
|
|
8
|
-
mergeron/core/guidelines_boundaries.py,sha256=
|
|
8
|
+
mergeron/core/guidelines_boundaries.py,sha256=IogILJd3LnF9DINpjML1kwpqn7kxrFrNGLIJgiN_bU0,37468
|
|
9
|
+
mergeron/core/guidelines_boundaries_specialized_functions.py,sha256=zrnqaPd7a_jIO1qtM9VXhiiADZRMpg6Y-e2m0od4_JM,10448
|
|
9
10
|
mergeron/core/proportions_tests.py,sha256=tCrbya1el5u1OFOXphODP6yWOGywuNY6z9LBTsNRKzM,15320
|
|
10
|
-
mergeron/core/pseudorandom_numbers.py,sha256=
|
|
11
|
+
mergeron/core/pseudorandom_numbers.py,sha256=uBK_fnhkOSkqnK4gEU8b3r_9B6r-vKmXZ64HViraTK8,9446
|
|
11
12
|
mergeron/examples/__init__.py,sha256=iyfxkX3-SoMS4ZQZKHKPn8JEMN536vpty9oSZf0LHv8,115
|
|
12
|
-
mergeron/examples/concentration_as_diversion.py,sha256=
|
|
13
|
-
mergeron/examples/enforcement_boundaries_for_mergers_with_asymmetric_shares.py,sha256
|
|
13
|
+
mergeron/examples/concentration_as_diversion.py,sha256=_RPId16pVGs1GxW5cZl1U1F0gIN8c0NPDvO2O7DbFGU,21505
|
|
14
|
+
mergeron/examples/enforcement_boundaries_for_mergers_with_asymmetric_shares.py,sha256=GhczLXtv1R7GtAJRngDTwda8fBKeX1Hdf6FZDlvqw60,16241
|
|
14
15
|
mergeron/examples/enforcement_boundaries_for_symmetric_firm_mergers.py,sha256=DAljm5NJquE56f-x4pLXzKCdhYQyVpWaM8uGlD6rIEs,5779
|
|
15
16
|
mergeron/examples/example_parameterizations.py,sha256=VP-hi7L0j30ffcEzmJ3P8mOj1VjwEWKCTZSx_CaVQxA,4197
|
|
16
17
|
mergeron/examples/guidelines_enforcement_patterns.py,sha256=iHGUaWCidVwIywI60ZNB4AnvzpTe60az1H7AzB3ddl0,2255
|
|
17
|
-
mergeron/examples/investigations_stats_obs_tables.py,sha256=
|
|
18
|
-
mergeron/examples/investigations_stats_sim_tables.py,sha256=
|
|
19
|
-
mergeron/examples/plotSafeHarbs_symbolically.py,sha256=
|
|
20
|
-
mergeron/examples/sound_guppi_safeharbor.py,sha256=
|
|
18
|
+
mergeron/examples/investigations_stats_obs_tables.py,sha256=RLJ7Y6tHgJ3ik2m2b7hsVwz-I8GzDBUtU0JQpRCjhtc,18017
|
|
19
|
+
mergeron/examples/investigations_stats_sim_tables.py,sha256=72oNhfp-rkLVf-pgFejWgW4kvs3hb0gIy9zgd7kJtto,14907
|
|
20
|
+
mergeron/examples/plotSafeHarbs_symbolically.py,sha256=YuuZd0zs1-icZKJnocbfRYqR2n5yHrbxjxtr2h5rYQo,1613
|
|
21
|
+
mergeron/examples/sound_guppi_safeharbor.py,sha256=0IGeFAJzkvpJEt-MnVkUcNCppj1FiRfUWf2FyKjV9Qo,6085
|
|
21
22
|
mergeron/examples/summarize_ftc_investigations_data.py,sha256=447vtwlAsfc3Po8wFcKRHC4Ur-zvKc5dwBjtu4M49ig,1360
|
|
22
23
|
mergeron/examples/testIntrinsicClearanceRates.py,sha256=T0-6m-SEPVy-mY8gZY2HlJO4ncBa47r87bERhhANLFs,5378
|
|
23
24
|
mergeron/examples/visualize_empirical_margin_distribution.py,sha256=eMTWgNJ1eSTZBgwojZXAYMfuzgMGM2UU999axNjBip4,2918
|
|
24
|
-
mergeron/examples/visualize_guidelines_tests.py,sha256=
|
|
25
|
+
mergeron/examples/visualize_guidelines_tests.py,sha256=2ZE7GRkGjVzvcwXkNAzGUKRGcf5Pb4ty-lQv0V1_LKU,9357
|
|
25
26
|
mergeron/ext/__init__.py,sha256=iyfxkX3-SoMS4ZQZKHKPn8JEMN536vpty9oSZf0LHv8,115
|
|
26
27
|
mergeron/ext/tol_colors.py,sha256=wFOHZXWZonbp9mhmSGu9mVujBYhdTsvx9_WikMpoCmo,22229
|
|
27
|
-
mergeron/gen/__init__.py,sha256=
|
|
28
|
-
mergeron/gen/_data_generation_functions_nonpublic.py,sha256=
|
|
29
|
-
mergeron/gen/data_generation.py,sha256=
|
|
28
|
+
mergeron/gen/__init__.py,sha256=nVvHJiUuTzTcT0mhX1BmneAiLkC1sg3I4X9xdu7OKJg,16248
|
|
29
|
+
mergeron/gen/_data_generation_functions_nonpublic.py,sha256=mt3g5sTPhUkJgsLd6luKkSnsT1_okf0y9kRyZtrBGk8,21404
|
|
30
|
+
mergeron/gen/data_generation.py,sha256=tud1PeobkTyNZdCk-cMVBHw1MtM7bJKq_cGaYnYFh_I,8863
|
|
30
31
|
mergeron/gen/investigations_stats.py,sha256=cZgghfUHmyU4ZY0Fi8R4iwf21YwzAzbrNpYsNbgEq6g,22812
|
|
31
|
-
mergeron/gen/upp_tests.py,sha256=
|
|
32
|
+
mergeron/gen/upp_tests.py,sha256=IlmedW20AG6XDp9gSG26RCLnZfMOVrm34PdpfJSJiMs,16229
|
|
32
33
|
mergeron/jinja_LaTex_templates/clrrate_cis_summary_table_template.tex.jinja2,sha256=ae4JiciU-pt8YAM8mRbsmt4W6ePuN1y1NPCWD95oXIo,4833
|
|
33
34
|
mergeron/jinja_LaTex_templates/ftcinvdata_byhhianddelta_table_template.tex.jinja2,sha256=ODEurkC0UHuWpjRUiQpeW85njSeUEUJYRdYg8gqoEq0,3642
|
|
34
35
|
mergeron/jinja_LaTex_templates/ftcinvdata_summary_table_template.tex.jinja2,sha256=h8_DEE0iskT9tnga5lZtxcoevN7pY4iKF-maErt4UU4,2906
|
|
@@ -37,6 +38,6 @@ mergeron/jinja_LaTex_templates/mergeron.cls,sha256=AV2mk4-uERvAuMkE95Ka7el6LZsb0
|
|
|
37
38
|
mergeron/jinja_LaTex_templates/mergeron_table_collection_template.tex.jinja2,sha256=nr6xUI0_2KHG4Sz9k1JFVQjs2h9qS9BGt1MeE6Tygs8,2429
|
|
38
39
|
mergeron/jinja_LaTex_templates/setup_tikz_tables.tex.jinja2,sha256=WKVxtp3eoMchfGliQAJMj4w2FtBkWG5z2V3-hBYUYUQ,3292
|
|
39
40
|
mergeron/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
40
|
-
mergeron-2024.738949.
|
|
41
|
-
mergeron-2024.738949.
|
|
42
|
-
mergeron-2024.738949.
|
|
41
|
+
mergeron-2024.738949.6.dist-info/METADATA,sha256=mVkXCzdVNRuYjbXj9CrtS4QdekNdslwEVKJAgqYa4y4,6362
|
|
42
|
+
mergeron-2024.738949.6.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
43
|
+
mergeron-2024.738949.6.dist-info/RECORD,,
|
|
File without changes
|