mergeron 2024.739099.2__py3-none-any.whl → 2024.739105.2__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.

@@ -1,9 +1,9 @@
1
1
  mergeron/License.txt,sha256=7iX-y0EyjkbVJKJLS4ZKzuuE1wd0lryfsD_IytLG8lQ,1246
2
- mergeron/__init__.py,sha256=A0iVjdlUd_UZWbclyBnPrbCH-JYk_JaMxVv8Dp5y-yU,1541
2
+ mergeron/__init__.py,sha256=-fDaCixxfelCFaf-M1R1psq0eeqYLG5m3YlXNbwgqoM,1454
3
3
  mergeron/core/__init__.py,sha256=KtjBlZOl7jwBCAUhrTJB9PdrN39YLYytNiSUSM_gRmA,62
4
4
  mergeron/core/damodaran_margin_data.py,sha256=rMrgN1Qtw572a0ftY97OOj4otq8ldlLrcOi-bcE-org,8554
5
- mergeron/core/ftc_merger_investigations_data.py,sha256=oL_4yrNPpjuNIluBsDc51lYd2Z4NBBrd7-sHKd3FCbg,28129
6
- mergeron/core/guidelines_boundaries.py,sha256=Lv-7EE7b2SiudpRjW3gFY1uHu-K0UdesewwiqaqjcOw,15585
5
+ mergeron/core/ftc_merger_investigations_data.py,sha256=qGAjjXEyqwS1PKKxvJGsSkr0sfI--4oyLss9I1qCNR4,28247
6
+ mergeron/core/guidelines_boundaries.py,sha256=EQ-T-Q94xKhGFp0Y5xheLUS4gptmyRInXfOEaeMHTAA,15530
7
7
  mergeron/core/guidelines_boundary_functions.py,sha256=gohb7Uj1AjJQtD5ew7bVZZjGhJEYCjNNAPB1o6TsA9M,29683
8
8
  mergeron/core/guidelines_boundary_functions_extra.py,sha256=t84dMsaMKnYUNuvvGrMCP6vI8MDn88PJOgGZlNe1Zts,11280
9
9
  mergeron/core/pseudorandom_numbers.py,sha256=cJEWDTfy9CUTzR_di6Fm1Vl1Le6xWoU8wFHbYVMEuLI,9225
@@ -20,13 +20,12 @@ mergeron/data/jinja2_LaTeX_templates/mergeron_table_collection_template.tex.jinj
20
20
  mergeron/data/jinja2_LaTeX_templates/setup_tikz_tables.tex,sha256=1hw3RINDtBrh9ZEToMIiNFIu9rozcPwRly69-5O_0UQ,3207
21
21
  mergeron/demo/__init__.py,sha256=KtjBlZOl7jwBCAUhrTJB9PdrN39YLYytNiSUSM_gRmA,62
22
22
  mergeron/demo/visualize_empirical_margin_distribution.py,sha256=v1xFJumBX2Ooye82kSSgly-_GpFVkYSDqBwM__rcmZY,2363
23
- mergeron/gen/__init__.py,sha256=a60dpqC8G8J518Tb3qEJvTvFnVTYSmgZfhciVckokfw,17051
24
- mergeron/gen/_data_generation_functions.py,sha256=tBdzpo-6WjwnHTB3uy2B6TE0e0Ajx0rgi6fVtW9I1b4,27386
25
- mergeron/gen/data_generation.py,sha256=dj9otFi1OE3Eo7f32BD0ZXm9Xvlg0fCp4DDQ_XhDN_w,8479
26
- mergeron/gen/enforcement_stats.py,sha256=p-CgaOo2qh5G9QZjCxZdbVazXeb_AJ_ABDOc2Kdtt-Q,27438
27
- mergeron/gen/market_sample.py,sha256=HkzRFTKBXYIs2HbAyVDUiUHo9nCtAciSn5sohR-34cM,4282
28
- mergeron/gen/upp_tests.py,sha256=ZnV_x2TQqhJuWnnG9aTLnw1OBisgHCwHYxy94OK8W9E,16846
23
+ mergeron/gen/__init__.py,sha256=bAimsNd7c8lQBBxzSiXyQXXxNRH-wHUe39l1aS1-EkE,16541
24
+ mergeron/gen/data_generation.py,sha256=yEoBYjO6NnGiMEy8QQg1DcbS4E5ytcPNUBONDuzjNns,16720
25
+ mergeron/gen/data_generation_functions.py,sha256=8vWDlmJjvRkBbMC_JQVyc5AVsr3Urvkvi2pVvk4hukc,28531
26
+ mergeron/gen/enforcement_stats.py,sha256=4YQYOeU3dqrOLejhK4chGZMO9ZoID9ZiJZ1V95eSboQ,27370
27
+ mergeron/gen/upp_tests.py,sha256=yzEwWK1bVfjtBYMwXnL5uEWWRiR0_9y0wmjNMB-O3rU,12589
29
28
  mergeron/py.typed,sha256=frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN_XKdLCPjaYaY,2
30
- mergeron-2024.739099.2.dist-info/METADATA,sha256=dyRrp-CAzkssNWLw44aQ-AbKKeuPFleWqEYaRPxaLG0,10922
31
- mergeron-2024.739099.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
32
- mergeron-2024.739099.2.dist-info/RECORD,,
29
+ mergeron-2024.739105.2.dist-info/METADATA,sha256=kCnvZdz_tS8xmbuVO7KDhSoQDVU-wqGFav1zicjyUcE,13911
30
+ mergeron-2024.739105.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
31
+ mergeron-2024.739105.2.dist-info/RECORD,,
@@ -1,143 +0,0 @@
1
- """
2
- Methods to generate data for analyzing merger enforcement policy.
3
-
4
- """
5
-
6
- from __future__ import annotations
7
-
8
- from attrs import define
9
- from numpy.random import SeedSequence
10
-
11
- from .. import VERSION # noqa: TID252
12
- from ..core.guidelines_boundaries import HMGThresholds # noqa: TID252
13
- from . import MarketSpec, UPPTestRegime
14
- from .data_generation import gen_market_sample
15
- from .upp_tests import SaveData, enf_cnts, save_data_to_hdf5, sim_enf_cnts_ll
16
-
17
- __version__ = VERSION
18
-
19
-
20
- @define(slots=False)
21
- class MarketSample(MarketSpec):
22
- def generate_sample(
23
- self,
24
- /,
25
- *,
26
- sample_size: int,
27
- seed_seq_list: list[SeedSequence] | None,
28
- nthreads: int,
29
- save_data_to_file: SaveData,
30
- ) -> None:
31
- """Generate market data
32
-
33
- Parameters
34
- ----------
35
- sample_size
36
- Size of the market sample drawn
37
-
38
- seed_seq_list
39
- List of :code:`numpy.random.SeedSequence` objects
40
-
41
- nthreads
42
- Number of threads to use
43
-
44
- save_data_to_file
45
- Save data to given HDF5 file, at specified group node
46
-
47
- Returns
48
- -------
49
- None
50
-
51
- Notes
52
- -----
53
- See documentation for :class:`mergeron.gen.data_generation.gen_market_sample`
54
- for more information, and :func:`mergeron.gen.data_generation.parse_seed_seq_list`
55
- on the specification of :code:`seed_seq_list`.
56
-
57
- """
58
- self.data = gen_market_sample(
59
- self,
60
- sample_size=sample_size,
61
- seed_seq_list=seed_seq_list,
62
- nthreads=nthreads,
63
- )
64
-
65
- _invalid_array_names = (
66
- ("fcounts", "choice_prob_outgd", "nth_firm_share", "hhi_post")
67
- if self.share_spec.dist_type == "Uniform"
68
- else ()
69
- )
70
-
71
- if save_data_to_file:
72
- save_data_to_hdf5(
73
- self.data,
74
- excluded_attrs=_invalid_array_names,
75
- save_data_to_file=save_data_to_file,
76
- )
77
-
78
- def estimate_enf_counts(
79
- self,
80
- _enf_parm_vec: HMGThresholds,
81
- _upp_test_regime: UPPTestRegime,
82
- /,
83
- *,
84
- sample_size: int = 10**6,
85
- seed_seq_list: list[SeedSequence] | None,
86
- nthreads: int,
87
- save_data_to_file: SaveData = False,
88
- ) -> None:
89
- """Generate market data
90
-
91
- Parameters
92
- ----------
93
- _enf_parm_vec
94
- Threshold values for various Guidelines criteria
95
-
96
- _upp_test_regime
97
- Specifies whether to analyze enforcement, clearance, or both
98
- and the GUPPI and diversion ratio aggregators employed, with
99
- default being to analyze enforcement based on the maximum
100
- merging-firm GUPPI and maximum diversion ratio between the
101
- merging firms
102
-
103
- sample_size
104
- Size of the market sample drawn
105
-
106
- seed_seq_list
107
- List of :code:`numpy.random.SeedSequence` objects
108
-
109
- nthreads
110
- Number of threads to use
111
-
112
- save_data_to_file
113
- Save data to given HDF5 file, at specified group node
114
-
115
- Returns
116
- -------
117
- None
118
-
119
- Notes
120
- -----
121
- See documentation for :class:`mergeron.gen.MarketSpec` for details on specifying
122
- how shares, margins, prices, and diversion ratios are generated, and whether to restrict
123
- the sample to draws representing mergers that meet the HSR filing requirements. See
124
- :class:`mergeron.gen.MarketDataSample` on the sample data generated; see,
125
- :func:`mergeron.gen.data_generation.parse_seed_seq_list` on
126
- the specification of :code:`seed_seq_list`.
127
-
128
- """
129
-
130
- if getattr(self, "market_data_sample", None) is None:
131
- self.enf_counts = sim_enf_cnts_ll(
132
- self,
133
- _enf_parm_vec,
134
- _upp_test_regime,
135
- sample_size=sample_size,
136
- seed_seq_list=seed_seq_list,
137
- nthreads=nthreads,
138
- save_data_to_file=save_data_to_file,
139
- )
140
- else:
141
- self.enf_counts = enf_cnts(self.data, _enf_parm_vec, _upp_test_regime)
142
- if save_data_to_file:
143
- save_data_to_hdf5(self.enf_counts, save_data_to_file=save_data_to_file)
@@ -1,102 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: mergeron
3
- Version: 2024.739099.2
4
- Summary: Merger Policy Analysis using Python
5
- License: MIT
6
- Keywords: merger policy analysis,merger guidelines,merger screening,policy presumptions,concentration standards,upward pricing pressure,GUPPI
7
- Author: Murthy Kambhampaty
8
- Author-email: smk@capeconomics.com
9
- Requires-Python: >=3.12,<4.0
10
- Classifier: Development Status :: 4 - Beta
11
- Classifier: Environment :: Console
12
- Classifier: Intended Audience :: End Users/Desktop
13
- Classifier: Intended Audience :: Science/Research
14
- Classifier: License :: OSI Approved :: MIT License
15
- Classifier: Operating System :: OS Independent
16
- Classifier: Programming Language :: Python
17
- Classifier: Programming Language :: Python :: 3
18
- Classifier: Programming Language :: Python :: 3.12
19
- Classifier: Programming Language :: Python :: 3 :: Only
20
- Classifier: Programming Language :: Python :: Implementation :: CPython
21
- Requires-Dist: aenum (>=3.1.15,<4.0.0)
22
- Requires-Dist: attrs (>=23.2)
23
- Requires-Dist: bs4 (>=0.0.1)
24
- Requires-Dist: certifi (>=2023.11.17)
25
- Requires-Dist: google-re2 (>=1.1)
26
- Requires-Dist: jinja2 (>=3.1)
27
- Requires-Dist: joblib (>=1.3)
28
- Requires-Dist: matplotlib (>=3.8)
29
- Requires-Dist: mpmath (>=1.3)
30
- Requires-Dist: msgpack (>=1.0)
31
- Requires-Dist: msgpack-numpy (>=0.4)
32
- Requires-Dist: numpy (>=1.26,<2)
33
- Requires-Dist: scipy (>=1.12)
34
- Requires-Dist: sympy (>=1.12)
35
- Requires-Dist: tables (>=3.8)
36
- Requires-Dist: types-beautifulsoup4 (>=4.11.2)
37
- Requires-Dist: urllib3 (>=2.2.2,<3.0.0)
38
- Requires-Dist: xlrd (>=2.0.1,<3.0.0)
39
- Requires-Dist: xlsxwriter (>=3.1)
40
- Description-Content-Type: text/x-rst
41
-
42
- mergeron: Merger Policy Analysis using Python
43
- =============================================
44
-
45
- Analyze the sets of mergers conforming to concentration and diversion ratio bounds. Analyze intrinsic enforcement rates, and intrinsic clearance rates, under concentration, diversion ratio, GUPPI, CMCR, and IPR bounds using generated data with specified distributions of market shares, price-cost margins, firm counts, and prices, optionally imposing restrictions implied by statutory filing thresholds and/or Bertrand-Nash oligopoly with MNL demand. Download and analyze merger investigations data published by the U.S. Federal Trade Commission in various reports on extended merger investigations (Second Requests) during 1996 to 2011.
46
-
47
- Here, enforcement rates derived with merger enforcement as being exogenous to firm conduct are defined as intrinsic enforcement rates, and similarly intrinsic clearance rates. Depending on the merger enforcement regime, or merger control regime, intrinsic enforcement rates may also not be the complement of intrinsic clearance rates, i.e, it is not necessarily true that the intrinsic clearance rate estimate for a given enforcement regime is 1 minus the intrinsic enforcement rate. In contrast, observed enforcement rates reflect the deterrent effects of merger enforcement on firm conduct as well as the effects of merger screening on the level of enforcement; and, by definition, the observed clearance rate is 1 minus the observed enforcement rate.
48
-
49
- Introduction
50
- ------------
51
-
52
- Module :code:`mergeron.core.guidelines_boundaries` includes classes for specifying concentration bounds (:code:`mergeron.core.guidelines_boundaries.ConcentrationBoundary`) and diversion-ratio bounds (:code:`mergeron.core.guidelines_boundaries.DiversionRatioBoundary`), with automatic generation of boundary (as an array of share-pairs) and area. This module also includes a function for generating plots of concentration and diversion-ratio boundaries, and functions for mapping GUPPI standards to concentration (ΔHHI) standards, and vice-versa.
53
-
54
- Module :code:`mergeron.gen.market_sample` includes the :code:`mergeron.gen.market_sample.MarketSample` with methods for, (i) generating sample data under a rich specification of shares, diversion ratios, margins, prices, and HSR filing requirements, and (ii) for estimating enforcement or clearance rates under specified enforcement regimes given a method of aggregating diversion ratio or GUPPI estimates for the firms in a merger. Notably. share are generated not just for markets with a fixed number of firms, but for markets with multiple firm-count weights, which may be left unspecified or explicitly specified.
55
-
56
- Unless otherwise specified, merging-firm shares are drawn with uniform distribution over the space :math:`s_1 + s_2 \leqslant 1` for an unspecified number of firms. Alternatively, shares may be drawn from the Dirichlet distribution, with specified shape parameters (see :code:`mergeron.gen.ShareConstants`. When drawing shares from the Dirichlet distribution, the user passes, using :code:`mergeron.gen.MarketSpec.ShareSpec.firm_count_weights`, a vector of weights specifying the frequency distribution over sequential firm counts, e.g., :code:`[133, 184, 134, 52, 32, 10, 12, 4, 3]` to specify shares drawn from Dirichlet distributions with 2 to 10 pre-merger firms distributed as in data for FTC merger investigations during 1996--2003 (See, for example, Table 4.1 of `FTC, Horizontal Merger Investigations Data, Fiscal Years 1996--2003 (Revised: August 31, 2004) <https://www.ftc.gov/sites/default/files/documents/reports/horizontal-merger-investigation-data-fiscal-years-1996-2003/040831horizmergersdata96-03.pdf>`_). If :code:`mergeron.gen.MarketSpec.ShareSpec.firm_count_weights` is not assigned a value when defining :code:`mergeron.gen.MarketSpec.ShareSpec` (which has type, :code:`mergeron.gen.ShareSpec`), the default values is used, with results in a sample of markets with 2 to 6 firms with equal relative frequency.
57
-
58
- Recapture rates can be specified as, "proportional", "inside-out", "outside-in" (see :code:`mergeron.RECConstants`. The "inside-out" specification results in recapture ratios consistent with merging-firms' in-market shares and a default recapture rate. The "outside-in" specification yields diversion ratios from purchase probabilities 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 (see, :code:`mergeron.gen.DiversionRatioSpec`). The "outside-in" specification is invalid when the distribution of markets over firm-count is unspecified, i.e., when :code:`mergeron.gen.MarketSpec.ShareSpec.dist_type ==`:code:`mergeron.gen.ShareConstants.UNI`.
59
-
60
- Price-cost-margins may be specified as having uniform distribution, Beta distribution (including a bounded Beta distribution with specified mean and variance), or an empirical distribution. The empirical margin distribution is based on resampling margin data published by Prof. Damodaran of NYU Stern School of Business (see Notes), using an estimated Gaussian KDE. The second merging firm's margin may be specified as symmetric, i.i.d., or subject to equilibrium conditions for (profit-maximization in) Bertrand-Nash oligopoly with MNL demand (see, :code:`mergeron.gen.PCMSpec`).
61
-
62
- 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 (see, :code:`mergeron.gen.PriceSpec`).
63
-
64
- The market sample may be restricted to mergers meeting the HSR filing requirement under two alternative approaches: in the one, the smaller of the two merging firms meets the HSR filing threshold for the smaller (acquired) firm. In the other, the :math:`n`-th firm's size matches the size requirement for the smaller merging firm (see, :code:`mergeron.gen.SSZConstants`). The second assumption avoids the unfortunate assumption in the first that, within the resulting sample, the larger merging firm be at least 10 times as large as the smaller merging firm, as a consequence of the full definition of the HSR filing requirement.
65
-
66
- The full specification of a market sample is given in a :code:`mergeron.gen.market_sample.MarketSample` object, including the above parameters. Data are drawn by invoking :code:`mergeron.gen.market_sample.MarketSample.generate_sample` which adds a :code:`data` property of class, :code:`mergeron.gen.MarketDataSample`. Enforcement or clearance counts are computed by invoking :code:`mergeron.gen.market_sample.MarketSample.estimate_enf_counts`, which adds an :code:`enf_counts` property of class :code:`mergeron.gen.UPPTestsCounts`. For fast, parallel generation of enforcement or clearance counts over large market data samples that ordinarily would exceed available limits on machine memory, the user can invoke the method :code:`estimate_enf_counts` on a :code:`mergeron.gen.market_sample.MarketSample` object without first invoking :code:`generate_sample`. Note, however, that this strategy does not retain the market sample in memory in the interests of conserving memory and maintaining high performance (the user can specify that the market sample and enforcement statistics be stored to permanent storage; when saving to current PCIe NVMe storage, the performance penalty is slight, but can be considerable if saving to SATA storage).
67
-
68
- Enforcement statistics based on FTC investigations data and test data are printed to screen or rendered to LaTex files (for processing into publication-quality tables) using methods provided in :code:`mergeron.gen.enforcement_stats`.
69
-
70
- Programs demonstrating the use of this package are included in the sub-package, :code:`mergeron.demo`.
71
-
72
- This package includes a class, :code:`mergeron.core.pseudorandom_numbers.MulithreadedRNG` 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. This class is an adaptation from the documentation of the :code:`numpy` package, from the discussion on `multithreaded random-number generation <https://numpy.org/doc/stable/reference/random/multithreading.html>_`; the version included here permits selection of the distribution with pre-tests to catch and inform on common errors. To access these directly:
73
-
74
- .. code-block:: python
75
-
76
- import mergeron.core.pseudorandom_numbers as prng
77
-
78
- 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:
79
-
80
- .. code-block:: python
81
-
82
- import mergeron.core.market_sample as market_sample
83
-
84
- help(market_sample.MarketSample)
85
-
86
- .. image:: https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json
87
- :alt: Poetry
88
- :target: https://python-poetry.org/
89
-
90
- .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
91
- :alt: Ruff
92
- :target: https://github.com/astral-sh/ruff
93
-
94
- .. image:: https://www.mypy-lang.org/static/mypy_badge.svg
95
- :alt: Checked with mypy
96
- :target: https://mypy-lang.org/
97
-
98
- .. image:: https://img.shields.io/badge/License-MIT-yellow.svg
99
- :alt: License: MIT
100
- :target: https://opensource.org/licenses/MIT
101
-
102
-