mergeron 2024.738953.1__py3-none-any.whl → 2024.738972.0__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/License.txt +1 -1
- mergeron/core/__init__.py +3 -3
- mergeron/core/excel_helper.py +3 -1
- mergeron/core/ftc_merger_investigations_data.py +13 -16
- mergeron/core/guidelines_boundaries.py +48 -45
- mergeron/core/guidelines_boundaries_specialized_functions.py +24 -21
- mergeron/gen/__init__.py +72 -80
- mergeron/gen/{_data_generation_functions_nonpublic.py → _data_generation_functions.py} +103 -47
- mergeron/gen/data_generation.py +42 -42
- mergeron/gen/investigations_stats.py +1 -1
- mergeron/gen/market_sample.py +79 -0
- mergeron/gen/upp_tests.py +143 -98
- {mergeron-2024.738953.1.dist-info → mergeron-2024.738972.0.dist-info}/METADATA +32 -17
- {mergeron-2024.738953.1.dist-info → mergeron-2024.738972.0.dist-info}/RECORD +15 -14
- {mergeron-2024.738953.1.dist-info → mergeron-2024.738972.0.dist-info}/WHEEL +0 -0
mergeron/gen/upp_tests.py
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
"""
|
|
2
|
-
|
|
2
|
+
Methods to estimate intrinsic clearnace rates and intrinsic enforcement rates
|
|
3
3
|
from generated market data.
|
|
4
4
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
from collections.abc import Sequence
|
|
8
8
|
from contextlib import suppress
|
|
9
|
-
from dataclasses import fields
|
|
10
9
|
from importlib.metadata import version
|
|
11
10
|
from pathlib import Path
|
|
12
11
|
from typing import Literal, TypeAlias, TypedDict
|
|
13
12
|
|
|
14
13
|
import numpy as np
|
|
15
14
|
import tables as ptb # type: ignore
|
|
16
|
-
from attrs import evolve
|
|
17
|
-
from attrs import fields as attrs_fields
|
|
18
15
|
from joblib import Parallel, cpu_count, delayed # type: ignore
|
|
19
16
|
from numpy.random import SeedSequence
|
|
20
17
|
from numpy.typing import NDArray
|
|
@@ -28,7 +25,7 @@ from . import (
|
|
|
28
25
|
DataclassInstance,
|
|
29
26
|
INVResolution,
|
|
30
27
|
MarketDataSample,
|
|
31
|
-
|
|
28
|
+
MarketSpec,
|
|
32
29
|
UPPTestRegime,
|
|
33
30
|
UPPTestsCounts,
|
|
34
31
|
UPPTestsRaw,
|
|
@@ -45,78 +42,106 @@ ptb.parameters.MAX_BLOSC_THREADS = 4
|
|
|
45
42
|
SaveData: TypeAlias = Literal[False] | tuple[Literal[True], ptb.File, ptb.Group]
|
|
46
43
|
|
|
47
44
|
|
|
48
|
-
class
|
|
49
|
-
|
|
45
|
+
class INVRESCntsArgs(TypedDict, total=False):
|
|
46
|
+
"Keyword arguments of function, :code:`sim_invres_cnts`"
|
|
47
|
+
|
|
50
48
|
saved_array_name_suffix: str
|
|
51
49
|
save_data_to_file: SaveData
|
|
52
|
-
|
|
50
|
+
sample_size: int
|
|
51
|
+
seed_seq_list: list[SeedSequence] | None
|
|
53
52
|
nthreads: int
|
|
54
53
|
|
|
55
54
|
|
|
56
55
|
def sim_invres_cnts_ll(
|
|
56
|
+
_mkt_sample_spec: MarketSpec,
|
|
57
57
|
_invres_parm_vec: gbl.HMGThresholds,
|
|
58
|
-
|
|
59
|
-
_sim_invres_cnts_kwargs: IVNRESCntsArgs,
|
|
58
|
+
_sim_test_regime: UPPTestRegime,
|
|
60
59
|
/,
|
|
60
|
+
*,
|
|
61
|
+
saved_array_name_suffix: str = "",
|
|
62
|
+
save_data_to_file: SaveData = False,
|
|
63
|
+
sample_size: int = 10**6,
|
|
64
|
+
seed_seq_list: list[SeedSequence] | None = None,
|
|
65
|
+
nthreads: int = 16,
|
|
61
66
|
) -> UPPTestsCounts:
|
|
62
|
-
"""
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
"""A function to parallelize data-generation and testing
|
|
68
|
+
|
|
69
|
+
The parameters `_sim_invres_cnts_kwargs` are passed unaltered to
|
|
70
|
+
the parent function, `sim_invres_cnts()`, except that, if provided,
|
|
71
|
+
`seed_seq_list` is used to spawn a seed sequence for each thread,
|
|
72
|
+
to assure independent samples in each thread, and `nthreads` defines
|
|
73
|
+
the number of parallel processes used. The number of draws in
|
|
74
|
+
each thread may be tuned, by trial and error, to the amount of
|
|
70
75
|
memory (RAM) available.
|
|
71
76
|
|
|
72
|
-
|
|
77
|
+
Parameters
|
|
78
|
+
----------
|
|
79
|
+
|
|
80
|
+
_invres_parm_vec
|
|
81
|
+
Guidelines thresholds to test against
|
|
82
|
+
|
|
83
|
+
_mkt_sample_spec
|
|
84
|
+
Configuration to use for generating sample data to test
|
|
85
|
+
|
|
86
|
+
_sim_test_regime
|
|
87
|
+
Configuration to use for testing
|
|
73
88
|
|
|
74
|
-
|
|
89
|
+
saved_array_name_suffix
|
|
90
|
+
Suffix to add to the array names in the HDF5 file
|
|
91
|
+
|
|
92
|
+
save_data_to_file
|
|
93
|
+
Whether to save data to an HDF5 file, and where to save it
|
|
94
|
+
|
|
95
|
+
sample_size
|
|
96
|
+
Number of draws to simulate
|
|
97
|
+
|
|
98
|
+
seed_seq_list
|
|
99
|
+
List of seed sequences, to assure independent samples in each thread
|
|
100
|
+
|
|
101
|
+
nthreads
|
|
102
|
+
Number of parallel processes to use
|
|
103
|
+
|
|
104
|
+
Returns
|
|
105
|
+
-------
|
|
106
|
+
Arrays of UPPTestCounts
|
|
107
|
+
|
|
108
|
+
"""
|
|
109
|
+
_sample_sz = sample_size
|
|
75
110
|
_subsample_sz = 10**6
|
|
76
111
|
_iter_count = int(_sample_sz / _subsample_sz) if _subsample_sz < _sample_sz else 1
|
|
77
112
|
_thread_count = cpu_count()
|
|
78
113
|
|
|
79
|
-
# Crate a copy, to avoid side effects in the outer scope
|
|
80
|
-
_mkt_sample_spec_here = evolve(_mkt_sample_spec, sample_size=_subsample_sz)
|
|
81
|
-
|
|
82
114
|
if (
|
|
83
|
-
_mkt_sample_spec.
|
|
84
|
-
and _mkt_sample_spec.share_spec.
|
|
115
|
+
_mkt_sample_spec.share_spec.recapture_form != RECConstants.OUTIN
|
|
116
|
+
and _mkt_sample_spec.share_spec.recapture_rate != _invres_parm_vec.rec
|
|
85
117
|
):
|
|
86
|
-
_mkt_sample_spec_here = evolve(
|
|
87
|
-
_mkt_sample_spec_here, recapture_rate=_invres_parm_vec.rec
|
|
88
|
-
)
|
|
89
|
-
elif _mkt_sample_spec.recapture_rate != _invres_parm_vec.rec:
|
|
90
118
|
raise ValueError(
|
|
91
|
-
"{} {} {}
|
|
92
|
-
f"
|
|
93
|
-
"
|
|
94
|
-
|
|
95
|
-
"in the first positional argument.",
|
|
119
|
+
"{} {} {}".format(
|
|
120
|
+
f"Recapture rate from market sample spec, {_mkt_sample_spec.share_spec.recapture_rate}",
|
|
121
|
+
f"must match the value, {_invres_parm_vec.rec}",
|
|
122
|
+
"the guidelines thresholds vector.",
|
|
96
123
|
)
|
|
97
124
|
)
|
|
98
125
|
|
|
99
126
|
_rng_seed_seq_list = [None] * _iter_count
|
|
100
|
-
if
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
)
|
|
127
|
+
if seed_seq_list:
|
|
128
|
+
_rng_seed_seq_list = list(
|
|
129
|
+
zip(*[g.spawn(_iter_count) for g in seed_seq_list], strict=True) # type: ignore
|
|
130
|
+
)
|
|
105
131
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
else:
|
|
112
|
-
_sim_invres_cnts_ll_kwargs = {}
|
|
132
|
+
_sim_invres_cnts_kwargs: INVRESCntsArgs = INVRESCntsArgs({
|
|
133
|
+
"sample_size": _subsample_sz,
|
|
134
|
+
"save_data_to_file": save_data_to_file,
|
|
135
|
+
"nthreads": nthreads,
|
|
136
|
+
})
|
|
113
137
|
|
|
114
138
|
_res_list = Parallel(n_jobs=_thread_count, prefer="threads")(
|
|
115
139
|
delayed(sim_invres_cnts)(
|
|
140
|
+
_mkt_sample_spec,
|
|
116
141
|
_invres_parm_vec,
|
|
117
|
-
|
|
118
|
-
**
|
|
119
|
-
saved_array_name_suffix=f"{_iter_id:0{2 + int(np.ceil(np.log10(_iter_count)))}d}",
|
|
142
|
+
_sim_test_regime,
|
|
143
|
+
**_sim_invres_cnts_kwargs,
|
|
144
|
+
saved_array_name_suffix=f"{saved_array_name_suffix}_{_iter_id:0{2 + int(np.ceil(np.log10(_iter_count)))}d}",
|
|
120
145
|
seed_seq_list=_rng_seed_seq_list_ch,
|
|
121
146
|
)
|
|
122
147
|
for _iter_id, _rng_seed_seq_list_ch in enumerate(_rng_seed_seq_list)
|
|
@@ -128,10 +153,12 @@ def sim_invres_cnts_ll(
|
|
|
128
153
|
])
|
|
129
154
|
upp_test_results = UPPTestsCounts(*[
|
|
130
155
|
np.column_stack((
|
|
131
|
-
(_gv := getattr(_res_list_stacks, _g
|
|
156
|
+
(_gv := getattr(_res_list_stacks, _g))[0, :, :_h],
|
|
132
157
|
np.einsum("ijk->jk", np.int64(1) * _gv[:, :, _h:]),
|
|
133
158
|
))
|
|
134
|
-
for _g, _h in zip(
|
|
159
|
+
for _g, _h in zip(
|
|
160
|
+
_res_list_stacks.__dataclass_fields__.keys(), [1, 1, 3], strict=True
|
|
161
|
+
)
|
|
135
162
|
])
|
|
136
163
|
del _res_list, _res_list_stacks
|
|
137
164
|
|
|
@@ -139,19 +166,23 @@ def sim_invres_cnts_ll(
|
|
|
139
166
|
|
|
140
167
|
|
|
141
168
|
def sim_invres_cnts(
|
|
169
|
+
_mkt_sample_spec: MarketSpec,
|
|
142
170
|
_upp_test_parms: gbl.HMGThresholds,
|
|
143
|
-
|
|
171
|
+
_sim_test_regime: UPPTestRegime,
|
|
144
172
|
/,
|
|
145
173
|
*,
|
|
146
|
-
sim_test_regime: UPPTestRegime,
|
|
147
174
|
saved_array_name_suffix: str = "",
|
|
148
175
|
save_data_to_file: SaveData = False,
|
|
176
|
+
sample_size: int = 10**6,
|
|
149
177
|
seed_seq_list: list[SeedSequence] | None = None,
|
|
150
178
|
nthreads: int = 16,
|
|
151
179
|
) -> UPPTestsCounts:
|
|
152
180
|
# Generate market data
|
|
153
|
-
|
|
154
|
-
_mkt_sample_spec,
|
|
181
|
+
_market_data_sample = dgl.gen_market_sample(
|
|
182
|
+
_mkt_sample_spec,
|
|
183
|
+
sample_size=sample_size,
|
|
184
|
+
seed_seq_list=seed_seq_list,
|
|
185
|
+
nthreads=nthreads,
|
|
155
186
|
)
|
|
156
187
|
|
|
157
188
|
_invalid_array_names = (
|
|
@@ -161,28 +192,42 @@ def sim_invres_cnts(
|
|
|
161
192
|
)
|
|
162
193
|
|
|
163
194
|
save_data_to_hdf5(
|
|
164
|
-
|
|
165
|
-
saved_array_name_suffix,
|
|
166
|
-
_invalid_array_names,
|
|
195
|
+
_market_data_sample,
|
|
196
|
+
saved_array_name_suffix=saved_array_name_suffix,
|
|
197
|
+
excluded_attrs=_invalid_array_names,
|
|
167
198
|
save_data_to_file=save_data_to_file,
|
|
168
199
|
)
|
|
169
200
|
|
|
170
|
-
|
|
171
|
-
_upp_test_parms,
|
|
172
|
-
|
|
173
|
-
|
|
201
|
+
_upp_test_arrays = invres_cnts(
|
|
202
|
+
_market_data_sample, _upp_test_parms, _sim_test_regime
|
|
203
|
+
)
|
|
204
|
+
|
|
205
|
+
save_data_to_hdf5(
|
|
206
|
+
_upp_test_arrays,
|
|
174
207
|
saved_array_name_suffix=saved_array_name_suffix,
|
|
175
208
|
save_data_to_file=save_data_to_file,
|
|
176
209
|
)
|
|
177
210
|
|
|
211
|
+
return _upp_test_arrays
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
def invres_cnts(
|
|
215
|
+
_market_data_sample: MarketDataSample,
|
|
216
|
+
_upp_test_parms: gbl.HMGThresholds,
|
|
217
|
+
_upp_test_regime: UPPTestRegime,
|
|
218
|
+
/,
|
|
219
|
+
) -> UPPTestsCounts:
|
|
220
|
+
_upp_test_arrays = gen_upp_test_arrays(
|
|
221
|
+
_market_data_sample, _upp_test_parms, _upp_test_regime
|
|
222
|
+
)
|
|
223
|
+
|
|
178
224
|
_fcounts, _hhi_delta, _hhi_post = (
|
|
179
|
-
getattr(
|
|
225
|
+
getattr(_market_data_sample, _g) for _g in ("fcounts", "hhi_delta", "hhi_post")
|
|
180
226
|
)
|
|
181
|
-
del _market_data
|
|
182
227
|
|
|
183
228
|
_stats_rowlen = 6
|
|
184
229
|
# Clearance/enforcement counts --- by firm count
|
|
185
|
-
_firm_counts_weights =
|
|
230
|
+
_firm_counts_weights = np.unique(_fcounts)
|
|
186
231
|
if _firm_counts_weights is not None and np.all(_firm_counts_weights >= 0):
|
|
187
232
|
_max_firm_count = len(_firm_counts_weights)
|
|
188
233
|
|
|
@@ -198,9 +243,9 @@ def sim_invres_cnts(
|
|
|
198
243
|
*[
|
|
199
244
|
np.einsum(
|
|
200
245
|
"ij->",
|
|
201
|
-
1 * (_firm_count_test & getattr(
|
|
246
|
+
1 * (_firm_count_test & getattr(_upp_test_arrays, _f)),
|
|
202
247
|
)
|
|
203
|
-
for _f in
|
|
248
|
+
for _f in _upp_test_arrays.__dataclass_fields__
|
|
204
249
|
],
|
|
205
250
|
]),
|
|
206
251
|
))
|
|
@@ -224,10 +269,9 @@ def sim_invres_cnts(
|
|
|
224
269
|
np.einsum("ij->", 1 * _hhi_delta_test),
|
|
225
270
|
*[
|
|
226
271
|
np.einsum(
|
|
227
|
-
"ij->",
|
|
228
|
-
1 * (_hhi_delta_test & getattr(_upp_tests_data, _f.name)),
|
|
272
|
+
"ij->", 1 * (_hhi_delta_test & getattr(_upp_test_arrays, _f))
|
|
229
273
|
)
|
|
230
|
-
for _f in
|
|
274
|
+
for _f in _upp_test_arrays.__dataclass_fields__
|
|
231
275
|
],
|
|
232
276
|
]),
|
|
233
277
|
))
|
|
@@ -262,9 +306,9 @@ def sim_invres_cnts(
|
|
|
262
306
|
np.einsum("ij->", 1 * _conc_test),
|
|
263
307
|
*[
|
|
264
308
|
np.einsum(
|
|
265
|
-
"ij->", 1 * (_conc_test & getattr(
|
|
309
|
+
"ij->", 1 * (_conc_test & getattr(_upp_test_arrays, _f))
|
|
266
310
|
)
|
|
267
|
-
for _f in
|
|
311
|
+
for _f in _upp_test_arrays.__dataclass_fields__
|
|
268
312
|
],
|
|
269
313
|
]),
|
|
270
314
|
))
|
|
@@ -282,15 +326,27 @@ def sim_invres_cnts(
|
|
|
282
326
|
)
|
|
283
327
|
|
|
284
328
|
|
|
285
|
-
def
|
|
286
|
-
_upp_test_parms: gbl.HMGThresholds,
|
|
329
|
+
def gen_upp_test_arrays(
|
|
287
330
|
_market_data: MarketDataSample,
|
|
331
|
+
_upp_test_parms: gbl.HMGThresholds,
|
|
288
332
|
_sim_test_regime: UPPTestRegime,
|
|
289
333
|
/,
|
|
290
|
-
*,
|
|
291
|
-
saved_array_name_suffix: str = "",
|
|
292
|
-
save_data_to_file: SaveData = False,
|
|
293
334
|
) -> UPPTestsRaw:
|
|
335
|
+
"""
|
|
336
|
+
Generate UPP tests arrays for given configuration and market sample
|
|
337
|
+
|
|
338
|
+
Given a standards vector, market
|
|
339
|
+
|
|
340
|
+
Parameters
|
|
341
|
+
----------
|
|
342
|
+
_market_data
|
|
343
|
+
market data sample
|
|
344
|
+
_upp_test_parms
|
|
345
|
+
guidelines thresholds for testing UPP and related statistics
|
|
346
|
+
_sim_test_regime
|
|
347
|
+
configuration to use for generating UPP tests
|
|
348
|
+
|
|
349
|
+
"""
|
|
294
350
|
_g_bar, _divr_bar, _cmcr_bar, _ipr_bar = (
|
|
295
351
|
getattr(_upp_test_parms, _f) for _f in ("guppi", "divr", "cmcr", "ipr")
|
|
296
352
|
)
|
|
@@ -391,29 +447,21 @@ def gen_upp_arrays(
|
|
|
391
447
|
_divr_test_vector = _market_data.divr_array.max(axis=1, keepdims=True)
|
|
392
448
|
|
|
393
449
|
if _invres_resolution == INVResolution.ENFT:
|
|
394
|
-
|
|
450
|
+
_upp_test_arrays = UPPTestsRaw(
|
|
395
451
|
_guppi_test_vector >= _g_bar,
|
|
396
452
|
(_guppi_test_vector >= _g_bar) | (_divr_test_vector >= _divr_bar),
|
|
397
453
|
_cmcr_test_vector >= _cmcr_bar,
|
|
398
454
|
_ipr_test_vector >= _ipr_bar,
|
|
399
455
|
)
|
|
400
456
|
else:
|
|
401
|
-
|
|
457
|
+
_upp_test_arrays = UPPTestsRaw(
|
|
402
458
|
_guppi_test_vector < _g_bar,
|
|
403
459
|
(_guppi_test_vector < _g_bar) & (_divr_test_vector < _divr_bar),
|
|
404
460
|
_cmcr_test_vector < _cmcr_bar,
|
|
405
461
|
_ipr_test_vector < _ipr_bar,
|
|
406
462
|
)
|
|
407
|
-
del _guppi_test_vector, _divr_test_vector, _cmcr_test_vector, _ipr_test_vector
|
|
408
|
-
|
|
409
|
-
save_data_to_hdf5(
|
|
410
|
-
_upp_tests_data,
|
|
411
|
-
saved_array_name_suffix,
|
|
412
|
-
(),
|
|
413
|
-
save_data_to_file=save_data_to_file,
|
|
414
|
-
)
|
|
415
463
|
|
|
416
|
-
return
|
|
464
|
+
return _upp_test_arrays
|
|
417
465
|
|
|
418
466
|
|
|
419
467
|
def initialize_hd5(
|
|
@@ -426,35 +474,32 @@ def initialize_hd5(
|
|
|
426
474
|
_save_data_to_file: tuple[Literal[True], ptb.File, str] = (True, _h5_file, "/")
|
|
427
475
|
_next_subgroup_name = "invres_{}_{}_{}_{}".format(
|
|
428
476
|
_hmg_pub_year,
|
|
429
|
-
*(
|
|
430
|
-
getattr(_test_regime, _f.name).name
|
|
431
|
-
for _f in attrs_fields(type(_test_regime))
|
|
432
|
-
),
|
|
477
|
+
*(getattr(_test_regime, _f.name).name for _f in _test_regime.__attrs_attrs__),
|
|
433
478
|
)
|
|
434
479
|
return _save_data_to_file, _next_subgroup_name
|
|
435
480
|
|
|
436
481
|
|
|
437
482
|
def save_data_to_hdf5(
|
|
438
483
|
_dclass: DataclassInstance,
|
|
439
|
-
_saved_array_name_suffix: str = "",
|
|
440
|
-
_excl_attrs: Sequence[str] = (),
|
|
441
484
|
/,
|
|
442
485
|
*,
|
|
486
|
+
saved_array_name_suffix: str | None = "",
|
|
487
|
+
excluded_attrs: Sequence[str] | None = (),
|
|
443
488
|
save_data_to_file: SaveData = False,
|
|
444
489
|
) -> None:
|
|
445
490
|
if save_data_to_file:
|
|
446
491
|
_, _h5_file, _h5_group = save_data_to_file
|
|
447
492
|
# Save market data arrays
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
if _array_name in
|
|
493
|
+
excluded_attrs = excluded_attrs or ()
|
|
494
|
+
for _array_name in _dclass.__dataclass_fields__:
|
|
495
|
+
if _array_name in excluded_attrs:
|
|
451
496
|
continue
|
|
452
497
|
save_array_to_hdf5(
|
|
453
498
|
getattr(_dclass, _array_name),
|
|
454
499
|
_array_name,
|
|
455
500
|
_h5_group,
|
|
456
501
|
_h5_file,
|
|
457
|
-
saved_array_name_suffix=
|
|
502
|
+
saved_array_name_suffix=saved_array_name_suffix,
|
|
458
503
|
)
|
|
459
504
|
|
|
460
505
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: mergeron
|
|
3
|
-
Version: 2024.
|
|
3
|
+
Version: 2024.738972.0
|
|
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
|
|
@@ -51,43 +51,58 @@ Intrinsic clearance and enforcement rates are distinguished from *observed* clea
|
|
|
51
51
|
Modules of primary interest
|
|
52
52
|
---------------------------
|
|
53
53
|
|
|
54
|
-
Routines for downloading and organizing FTC merger investigtions data published in 2004, 2007, 2008, and 2013. Includes a routine for constructing investigations data for non-overlapping periods, and other partitions on the data, subject to the constraints of the reported data.
|
|
55
54
|
|
|
56
|
-
mergeron.core.ftc_merger_investigations_data
|
|
57
55
|
|
|
58
|
-
|
|
56
|
+
Methods for plotting boundaries of (sets of mergers falling within) specified concentration and share-ratio boundaries, are in :code:`mergeron.core.guidelines_boundaries`, where share-ratio, :math:`\delta_{ij}` is defined as :math:`\delta_{ij} = d_{ij} / r_i` with :math:`d_{ij}, r_i` a diversion ratio and recapture rate. This module also includes functions for calibrating GUPPI thresholds to concentration (ΔHHI) thresholds, and vice-versa.
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
Methods for generating industry data under various distributions of shares, prices, and margins are included in, :code:`mergeron.gen.data_generation`. The user can specify whether rates are specified as, "proportional", "inside-out" (i.e., consistent with merging-firms' in-market shares and a default recapture rate), or "outside-in", (i.e., purchase probabilities are drawn at random for :math:`n+1` goods, from which are derived market shares and recapture rates for the :math:`n` goods in the putative market). Price-cost-margins may be specified as symmetric, i.i.d, or consistent with equilibrium conditions for (profit-mazimization in) Bertrand-Nash oligopoly with MNL demand. Prices may be specified as symmetric or asymmetric, and in the latter case, the direction of correlation between merging firm prices, if any, can also be specified. Two alternative approaches for modeling statutory filing requirements (HSR filing thresholds) are implemented.
|
|
61
59
|
|
|
62
|
-
|
|
60
|
+
Methods for testing generated industry data against criteria on diversion ratio, gross upward pricing pressure ("GUPPI"), critical marginal cost reduction ("CMCR"), and indicative price rise ("IPR")/partial merger simulation are included in the module, :code:`mergeron.gen.guidelines_tests`. Test data are constructed in parallel and the user can specify number of `threads` and sub-sample size for each thread to manage CPU and memory utilization.
|
|
63
61
|
|
|
64
|
-
|
|
62
|
+
FTC investigations data and test data are printed to screen or rendered in LaTex to text files (for processing into publication-quality tables) using methods provided in :code:`mergeron.gen.investigations_stats`.
|
|
65
63
|
|
|
66
|
-
|
|
64
|
+
Programs demonstrating the analysis and reporting facilites provided by the sub-package, :code:`mergeron.examples`.
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
This package exposes methods employed for generating random numbers with selected continuous distribution over specified parameters, and with CPU multithreading on machines with multiple virtual, logical, or physical CPU cores. To access these directly:
|
|
69
67
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
Programs demonstrating the analysis and reporting facilites provided by the package.
|
|
73
|
-
|
|
74
|
-
mergeron.examples
|
|
75
|
-
|
|
76
|
-
This package exposes routines employed for generating random numbers with selected continuous distribution over specified parameters, and with CPU multithreading on machines with multiple virtual, logical, or physical CPU cores. To access these directly:
|
|
68
|
+
.. code-block:: python
|
|
77
69
|
|
|
78
70
|
import mergeron.core.pseudorandom_numbers as prng
|
|
79
71
|
|
|
80
|
-
Also included are
|
|
72
|
+
Also included are methods for estimating confidence intervals for proportions and for contrasts (differences) in proportions. (Although coded from scratch using the source literature, the APIs implemented in the module included here are designed for consistency with the APIs in, :code:`statsmodels.stats.proportion` from the package, :code:`statsmodels` (https://pypi.org/project/statsmodels/).) To access these directly:
|
|
73
|
+
|
|
74
|
+
.. code-block:: python
|
|
81
75
|
|
|
82
76
|
import mergeron.core.proportions_tests as prci
|
|
83
77
|
|
|
84
78
|
A recent version of Paul Tol's python module, :code:`tol_colors.py` is redistributed within this package. Other than re-formatting and type annotation, the :code:`tol_colors` module is re-distributed as downloaded from, https://personal.sron.nl/~pault/data/tol_colors.py. The tol_colors.py module is distributed under the Standard 3-clause BSD license. To access the tol_colors module directly:
|
|
85
79
|
|
|
80
|
+
.. code-block:: python
|
|
81
|
+
|
|
86
82
|
import mergeron.ext.tol_colors
|
|
87
83
|
|
|
88
84
|
Documentation for this package is in the form of the API Reference. Documentation for individual functions and classes is accessible within a python shell. For example:
|
|
89
85
|
|
|
86
|
+
.. code-block:: python
|
|
87
|
+
|
|
90
88
|
import mergeron.core.data_generation as dgl
|
|
91
89
|
|
|
92
90
|
help(dgl.gen_market_sample)
|
|
93
91
|
|
|
92
|
+
|
|
93
|
+
.. image:: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
|
|
94
|
+
:alt: Poetry
|
|
95
|
+
:target: https://python-poetry.org/
|
|
96
|
+
|
|
97
|
+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
|
|
98
|
+
:alt: Ruff
|
|
99
|
+
:target: https://github.com/astral-sh/ruff
|
|
100
|
+
|
|
101
|
+
.. image:: https://www.mypy-lang.org/static/mypy_badge.svg
|
|
102
|
+
:alt: Checked with mypy
|
|
103
|
+
:target: https://mypy-lang.org/
|
|
104
|
+
|
|
105
|
+
.. image:: https://img.shields.io/badge/License-MIT-yellow.svg
|
|
106
|
+
:alt: License: MIT
|
|
107
|
+
:target: https://opensource.org/licenses/MIT
|
|
108
|
+
|
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
mergeron/License.txt,sha256=
|
|
1
|
+
mergeron/License.txt,sha256=7iX-y0EyjkbVJKJLS4ZKzuuE1wd0lryfsD_IytLG8lQ,1246
|
|
2
2
|
mergeron/__init__.py,sha256=_0Bt2k2P8MPlF_WagQKGspaSODn-pkqib0uvSd4gys4,1019
|
|
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=NWalI-uDifb8Y8bDN4BFNH2IoCAx3C60_Dz3bwbxveY,2085
|
|
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=XfdKNOEdB5zNJl8LguVyAcDjr5y2wapKDbNgAx6r-es,7831
|
|
7
7
|
mergeron/core/ftc_invdata.msgpack,sha256=WBFHgi7Ld4R-h2zL2Zc3TOIlKqVrbVFMH1LoI4-T-M0,264664
|
|
8
|
-
mergeron/core/ftc_merger_investigations_data.py,sha256=
|
|
9
|
-
mergeron/core/guidelines_boundaries.py,sha256=
|
|
10
|
-
mergeron/core/guidelines_boundaries_specialized_functions.py,sha256=
|
|
8
|
+
mergeron/core/ftc_merger_investigations_data.py,sha256=wHF1dKAqWlh1hMvaQv2uOCAKAHnuPvCGnmaOB3CJO9I,26929
|
|
9
|
+
mergeron/core/guidelines_boundaries.py,sha256=h--dAO449VyhhVJ-GjzQ56L-Bq_Zz-PXonBHKRsBQmE,37554
|
|
10
|
+
mergeron/core/guidelines_boundaries_specialized_functions.py,sha256=OiTu_MIvw_f93ESpTpMBL6rVqTLPyqE-fhf62mgGNxA,10620
|
|
11
11
|
mergeron/core/proportions_tests.py,sha256=tCrbya1el5u1OFOXphODP6yWOGywuNY6z9LBTsNRKzM,15320
|
|
12
12
|
mergeron/core/pseudorandom_numbers.py,sha256=uBK_fnhkOSkqnK4gEU8b3r_9B6r-vKmXZ64HViraTK8,9446
|
|
13
13
|
mergeron/ext/__init__.py,sha256=iyfxkX3-SoMS4ZQZKHKPn8JEMN536vpty9oSZf0LHv8,115
|
|
14
14
|
mergeron/ext/tol_colors.py,sha256=wFOHZXWZonbp9mhmSGu9mVujBYhdTsvx9_WikMpoCmo,22229
|
|
15
|
-
mergeron/gen/__init__.py,sha256=
|
|
16
|
-
mergeron/gen/
|
|
17
|
-
mergeron/gen/data_generation.py,sha256=
|
|
18
|
-
mergeron/gen/investigations_stats.py,sha256=
|
|
19
|
-
mergeron/gen/
|
|
15
|
+
mergeron/gen/__init__.py,sha256=GSFduoVwk0dOqogqX-YdWMtlxSM6G3tyFqf6U43okV4,16268
|
|
16
|
+
mergeron/gen/_data_generation_functions.py,sha256=QLxeS35D3bqQjjDabq1QncqwptMaHBrtmZ-_JUo6SG4,23202
|
|
17
|
+
mergeron/gen/data_generation.py,sha256=7teP8OKgKp08riX2Yu7flMEvN6a_eNXJllv_Hdkt7W8,8842
|
|
18
|
+
mergeron/gen/investigations_stats.py,sha256=4-AY_zhqKSlGE8sQciuYxzg2U4efQs2014dydmWUFz4,22802
|
|
19
|
+
mergeron/gen/market_sample.py,sha256=HQbdmzAEub9vZDXjwPzZOZrTRHDLwn5fDhcTgeOwSlQ,2399
|
|
20
|
+
mergeron/gen/upp_tests.py,sha256=OaEEo1ARSza2-PFsZaFArC2bOdo2qKG3k1jubhg-ccQ,17217
|
|
20
21
|
mergeron/jinja_LaTex_templates/clrrate_cis_summary_table_template.tex.jinja2,sha256=ae4JiciU-pt8YAM8mRbsmt4W6ePuN1y1NPCWD95oXIo,4833
|
|
21
22
|
mergeron/jinja_LaTex_templates/ftcinvdata_byhhianddelta_table_template.tex.jinja2,sha256=ODEurkC0UHuWpjRUiQpeW85njSeUEUJYRdYg8gqoEq0,3642
|
|
22
23
|
mergeron/jinja_LaTex_templates/ftcinvdata_summary_table_template.tex.jinja2,sha256=h8_DEE0iskT9tnga5lZtxcoevN7pY4iKF-maErt4UU4,2906
|
|
@@ -25,6 +26,6 @@ mergeron/jinja_LaTex_templates/mergeron.cls,sha256=AV2mk4-uERvAuMkE95Ka7el6LZsb0
|
|
|
25
26
|
mergeron/jinja_LaTex_templates/mergeron_table_collection_template.tex.jinja2,sha256=nr6xUI0_2KHG4Sz9k1JFVQjs2h9qS9BGt1MeE6Tygs8,2429
|
|
26
27
|
mergeron/jinja_LaTex_templates/setup_tikz_tables.tex.jinja2,sha256=WKVxtp3eoMchfGliQAJMj4w2FtBkWG5z2V3-hBYUYUQ,3292
|
|
27
28
|
mergeron/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
|
|
28
|
-
mergeron-2024.
|
|
29
|
-
mergeron-2024.
|
|
30
|
-
mergeron-2024.
|
|
29
|
+
mergeron-2024.738972.0.dist-info/METADATA,sha256=qJ2QkDvJJZ5L6ETVxFB7KX_uB0FktsbTovnSj7GSiMQ,6925
|
|
30
|
+
mergeron-2024.738972.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
31
|
+
mergeron-2024.738972.0.dist-info/RECORD,,
|
|
File without changes
|