mergeron 2024.739105.2__tar.gz → 2024.739105.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (31) hide show
  1. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/PKG-INFO +6 -6
  2. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/README.rst +5 -5
  3. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/pyproject.toml +2 -2
  4. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/__init__.py +3 -1
  5. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/core/guidelines_boundaries.py +21 -10
  6. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/core/guidelines_boundary_functions.py +5 -5
  7. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/core/guidelines_boundary_functions_extra.py +3 -3
  8. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/gen/__init__.py +6 -3
  9. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/gen/data_generation.py +4 -2
  10. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/gen/data_generation_functions.py +9 -5
  11. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/License.txt +0 -0
  12. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/core/__init__.py +0 -0
  13. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/core/damodaran_margin_data.py +0 -0
  14. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/core/ftc_merger_investigations_data.py +0 -0
  15. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/core/pseudorandom_numbers.py +0 -0
  16. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/__init__.py +0 -0
  17. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/damodaran_margin_data.xls +0 -0
  18. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/damodaran_margin_data_dict.msgpack +0 -0
  19. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/ftc_invdata.msgpack +0 -0
  20. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/jinja2_LaTeX_templates/clrrate_cis_summary_table_template.tex.jinja2 +0 -0
  21. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/jinja2_LaTeX_templates/ftcinvdata_byhhianddelta_table_template.tex.jinja2 +0 -0
  22. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/jinja2_LaTeX_templates/ftcinvdata_summary_table_template.tex.jinja2 +0 -0
  23. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/jinja2_LaTeX_templates/ftcinvdata_summarypaired_table_template.tex.jinja2 +0 -0
  24. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/jinja2_LaTeX_templates/mergeron.cls +0 -0
  25. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/jinja2_LaTeX_templates/mergeron_table_collection_template.tex.jinja2 +0 -0
  26. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/data/jinja2_LaTeX_templates/setup_tikz_tables.tex +0 -0
  27. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/demo/__init__.py +0 -0
  28. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/demo/visualize_empirical_margin_distribution.py +0 -0
  29. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/gen/enforcement_stats.py +0 -0
  30. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/gen/upp_tests.py +0 -0
  31. {mergeron-2024.739105.2 → mergeron-2024.739105.4}/src/mergeron/py.typed +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mergeron
3
- Version: 2024.739105.2
3
+ Version: 2024.739105.4
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
@@ -49,16 +49,16 @@ Here, enforcement rates derived with merger enforcement as being exogenous to fi
49
49
  Introduction
50
50
  ------------
51
51
 
52
- Module :code:`.core.guidelines_boundaries` includes classes for specifying concentration bounds (:code:`..core.guidelines_boundaries.ConcentrationBoundary`) and diversion-ratio bounds (:code:`..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.
52
+ Module :code:`.core.guidelines_boundaries` includes classes for specifying concentration bounds (:code:`.core.guidelines_boundaries.ConcentrationBoundary`) and diversion-ratio bounds (:code:`.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
53
 
54
54
  Module :code:`.gen.data_generation` includes the :code:`.gen.data_generation.MarketSample` which provides for a rich specification of shares and diversion ratios (:code:`.gen.data_generation.MarketSample.share_spec`), margins (:code:`.gen.data_generation.MarketSample.pcm_spec`, prices (:code:`.gen.data_generation.MarketSample.price_spec`), and HSR filing requirements (:code:`.gen.data_generation.MarketSample.hsr_filing_test_type`), and with methods for, (i) generating sample data (:code:`.gen.data_generation.MarketSample.generate_sample`), and (ii) 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 (:code:`.gen.data_generation.MarketSample.estimate_enf_counts`). While the latter populate the properties, :code:`.gen.data_generation.MarketSample.data`
55
- and :code:`.gen.data_generation.MarketSample.enf_counts`, respectively, the underlying methods for generating standalone :code:`MarketDataSample` and :code:`UPPTestCounts` objects are included in the class definition, with helper functions defined in the modules, :code:`.gen.data_generation_functions` and :code:`.gen.upp_tests`. Notably, market shares are generated for a sample of markets with firm-count distributed as specified in :code:`.gen.data_generation.MarketSample.ShareSpec.firm_count_weights`, with defaults as discussed below (also see, :code:`.gen.ShareSpec.firm_count_weights`.
55
+ and :code:`.gen.data_generation.MarketSample.enf_counts`, respectively, the underlying methods for generating standalone :code:`MarketDataSample` and :code:`UPPTestCounts` objects are included in the class definition, with helper functions defined in the modules, :code:`.gen.data_generation_functions` and :code:`.gen.upp_tests`. Notably, market shares are generated for a sample of markets with firm-count distributed as specified in :code:`.gen.data_generation.MarketSample.share_spec.firm_count_weights`, with defaults as discussed below (also see, :code:`.gen.ShareSpec.firm_count_weights`.
56
56
 
57
- By default, 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:`.gen.data_generation.MarketSample.ShareSpec`, and, specifically, :code:`.gen.SHRDistribution`). When drawing shares from the Dirichlet distribution, the user passes, using :code:`.gen.data_generation.MarketSample.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:`.gen.data_generation.MarketSample.ShareSpec.firm_count_weights` is not explicitly assigned a value when defining :code:`.gen.data_generation.MarketSample.ShareSpec`, the default values is used, which results in a sample of markets with 2 to 7 firms with relative frequency in inverse proportion to firm-count, with 2-firm markets being 6 times as likely to be drawn as 7-firm markets.
57
+ By default, 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 property `dist_type` of :code:`.gen.data_generation.MarketSample.share_spec`, of type, :code:`.gen.SHRDistribution`). When drawing shares from the Dirichlet distribution, the user specifies the `firm_count_weights` property of :code:`.gen.data_generation.MarketSample.share_spec`, as 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 the property `firm_count_weights` is not explicitly assigned a value when defining :code:`.gen.data_generation.MarketSample.share_spec`, the default values is used, which results in a sample of markets with 2 to 7 firms with relative frequency in inverse proportion to firm-count, with 2-firm markets being 6 times as likely to be drawn as 7-firm markets.
58
58
 
59
- Recapture rates can be specified as, "proportional", "inside-out", "outside-in" (see :code:`.RECForm`. The "inside-out" specification (:code:`.gen.data_generation.MarketSample.ShareSpec.recapture_form`:code:` = `:code:`.RECForm.INOUT`) results in recapture ratios consistent with merging-firms' in-market shares and a default recapture rate. The "outside-in" specification (:code:`.gen.data_generation.MarketSample.ShareSpec.recapture_form`:code:` = `:code:`.RECForm.INOUT`) 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:`.gen.ShareSpec`). The "outside-in" specification is invalid when the distribution of markets over firm-count is unspecified, i.e., when :code:`.gen.data_generation.MarketSample.ShareSpec.dist_type`:code:` ==`:code:`.gen.ShareDistributions.UNI`, thus raising a :code:`ValueError` exception. The "proportional" form (:code:`.gen.data_generation.MarketSample.ShareSpec.recapture_form`:code:` = `:code:`.RECForm.FIXED`) is often used in the literature, as an approximation to the "inside-out" form. See, for example, Coate (2011).
59
+ Recapture rates can be specified as, "proportional", "inside-out", "outside-in" (see :code:`.RECForm`). The "inside-out" specification (assigning :code:`.RECForm.INOUT` to the `recapture_form` property of :code:`.gen.data_generation.MarketSample.share_spec`) results in recapture ratios consistent with merging-firms' in-market shares and a default recapture rate. The "outside-in" specification (assigning :code:`.RECForm.INOUT` to the `recapture_form` property of :code:`.gen.data_generation.MarketSample.share_spec`) 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:`.gen.ShareSpec`). The "outside-in" specification is invalid when the distribution of markets over firm-count is unspecified, i.e., when the property `dist_type` of :code:`.gen.data_generation.MarketSample.share_spec` is assigned :code:`.gen.ShareDistributions.UNI`, raising a :code:`ValueError` exception. The "proportional" form (`recapture_form` = :code:`.RECForm.FIXED`) is often used in the literature, as an approximation to the "inside-out" calibration. See, for example, Coate (2011).
60
60
 
61
- 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 (see, :code:`.gen.PCMSpec`). 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 (:code:`.gen.data_generation.MarketSample.PCMSpec.firm2_pcm_constraint`) may be specified as symmetric, i.i.d., or subject to equilibrium conditions for (profit-maximization in) Bertrand-Nash oligopoly with MNL demand (:code:`.gen.FM2Constraint`).
61
+ 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 (see, :code:`.gen.PCMSpec`). 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 (per the property `firm2_pcm_constraint` of :code:`.gen.data_generation.MarketSample.pcm_spec`) may be specified as symmetric, i.i.d., or subject to equilibrium conditions for (profit-maximization in) Bertrand-Nash oligopoly with MNL demand (:code:`.gen.FM2Constraint`).
62
62
 
63
63
  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:`.gen.PriceSpec`). Prices may also be defined by imposing cost symmetry on firms in the sample, with fixed unit marginal costs normalized to 1 unit, such that price equal :math:`1 / (1 - \pmb{m})`, where :math:`\pmb{m}` represents the array of margins for firms in the sample.
64
64
 
@@ -8,16 +8,16 @@ Here, enforcement rates derived with merger enforcement as being exogenous to fi
8
8
  Introduction
9
9
  ------------
10
10
 
11
- Module :code:`.core.guidelines_boundaries` includes classes for specifying concentration bounds (:code:`..core.guidelines_boundaries.ConcentrationBoundary`) and diversion-ratio bounds (:code:`..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.
11
+ Module :code:`.core.guidelines_boundaries` includes classes for specifying concentration bounds (:code:`.core.guidelines_boundaries.ConcentrationBoundary`) and diversion-ratio bounds (:code:`.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.
12
12
 
13
13
  Module :code:`.gen.data_generation` includes the :code:`.gen.data_generation.MarketSample` which provides for a rich specification of shares and diversion ratios (:code:`.gen.data_generation.MarketSample.share_spec`), margins (:code:`.gen.data_generation.MarketSample.pcm_spec`, prices (:code:`.gen.data_generation.MarketSample.price_spec`), and HSR filing requirements (:code:`.gen.data_generation.MarketSample.hsr_filing_test_type`), and with methods for, (i) generating sample data (:code:`.gen.data_generation.MarketSample.generate_sample`), and (ii) 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 (:code:`.gen.data_generation.MarketSample.estimate_enf_counts`). While the latter populate the properties, :code:`.gen.data_generation.MarketSample.data`
14
- and :code:`.gen.data_generation.MarketSample.enf_counts`, respectively, the underlying methods for generating standalone :code:`MarketDataSample` and :code:`UPPTestCounts` objects are included in the class definition, with helper functions defined in the modules, :code:`.gen.data_generation_functions` and :code:`.gen.upp_tests`. Notably, market shares are generated for a sample of markets with firm-count distributed as specified in :code:`.gen.data_generation.MarketSample.ShareSpec.firm_count_weights`, with defaults as discussed below (also see, :code:`.gen.ShareSpec.firm_count_weights`.
14
+ and :code:`.gen.data_generation.MarketSample.enf_counts`, respectively, the underlying methods for generating standalone :code:`MarketDataSample` and :code:`UPPTestCounts` objects are included in the class definition, with helper functions defined in the modules, :code:`.gen.data_generation_functions` and :code:`.gen.upp_tests`. Notably, market shares are generated for a sample of markets with firm-count distributed as specified in :code:`.gen.data_generation.MarketSample.share_spec.firm_count_weights`, with defaults as discussed below (also see, :code:`.gen.ShareSpec.firm_count_weights`.
15
15
 
16
- By default, 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:`.gen.data_generation.MarketSample.ShareSpec`, and, specifically, :code:`.gen.SHRDistribution`). When drawing shares from the Dirichlet distribution, the user passes, using :code:`.gen.data_generation.MarketSample.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:`.gen.data_generation.MarketSample.ShareSpec.firm_count_weights` is not explicitly assigned a value when defining :code:`.gen.data_generation.MarketSample.ShareSpec`, the default values is used, which results in a sample of markets with 2 to 7 firms with relative frequency in inverse proportion to firm-count, with 2-firm markets being 6 times as likely to be drawn as 7-firm markets.
16
+ By default, 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 property `dist_type` of :code:`.gen.data_generation.MarketSample.share_spec`, of type, :code:`.gen.SHRDistribution`). When drawing shares from the Dirichlet distribution, the user specifies the `firm_count_weights` property of :code:`.gen.data_generation.MarketSample.share_spec`, as 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 the property `firm_count_weights` is not explicitly assigned a value when defining :code:`.gen.data_generation.MarketSample.share_spec`, the default values is used, which results in a sample of markets with 2 to 7 firms with relative frequency in inverse proportion to firm-count, with 2-firm markets being 6 times as likely to be drawn as 7-firm markets.
17
17
 
18
- Recapture rates can be specified as, "proportional", "inside-out", "outside-in" (see :code:`.RECForm`. The "inside-out" specification (:code:`.gen.data_generation.MarketSample.ShareSpec.recapture_form`:code:` = `:code:`.RECForm.INOUT`) results in recapture ratios consistent with merging-firms' in-market shares and a default recapture rate. The "outside-in" specification (:code:`.gen.data_generation.MarketSample.ShareSpec.recapture_form`:code:` = `:code:`.RECForm.INOUT`) 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:`.gen.ShareSpec`). The "outside-in" specification is invalid when the distribution of markets over firm-count is unspecified, i.e., when :code:`.gen.data_generation.MarketSample.ShareSpec.dist_type`:code:` ==`:code:`.gen.ShareDistributions.UNI`, thus raising a :code:`ValueError` exception. The "proportional" form (:code:`.gen.data_generation.MarketSample.ShareSpec.recapture_form`:code:` = `:code:`.RECForm.FIXED`) is often used in the literature, as an approximation to the "inside-out" form. See, for example, Coate (2011).
18
+ Recapture rates can be specified as, "proportional", "inside-out", "outside-in" (see :code:`.RECForm`). The "inside-out" specification (assigning :code:`.RECForm.INOUT` to the `recapture_form` property of :code:`.gen.data_generation.MarketSample.share_spec`) results in recapture ratios consistent with merging-firms' in-market shares and a default recapture rate. The "outside-in" specification (assigning :code:`.RECForm.INOUT` to the `recapture_form` property of :code:`.gen.data_generation.MarketSample.share_spec`) 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:`.gen.ShareSpec`). The "outside-in" specification is invalid when the distribution of markets over firm-count is unspecified, i.e., when the property `dist_type` of :code:`.gen.data_generation.MarketSample.share_spec` is assigned :code:`.gen.ShareDistributions.UNI`, raising a :code:`ValueError` exception. The "proportional" form (`recapture_form` = :code:`.RECForm.FIXED`) is often used in the literature, as an approximation to the "inside-out" calibration. See, for example, Coate (2011).
19
19
 
20
- 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 (see, :code:`.gen.PCMSpec`). 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 (:code:`.gen.data_generation.MarketSample.PCMSpec.firm2_pcm_constraint`) may be specified as symmetric, i.i.d., or subject to equilibrium conditions for (profit-maximization in) Bertrand-Nash oligopoly with MNL demand (:code:`.gen.FM2Constraint`).
20
+ 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 (see, :code:`.gen.PCMSpec`). 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 (per the property `firm2_pcm_constraint` of :code:`.gen.data_generation.MarketSample.pcm_spec`) may be specified as symmetric, i.i.d., or subject to equilibrium conditions for (profit-maximization in) Bertrand-Nash oligopoly with MNL demand (:code:`.gen.FM2Constraint`).
21
21
 
22
22
  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:`.gen.PriceSpec`). Prices may also be defined by imposing cost symmetry on firms in the sample, with fixed unit marginal costs normalized to 1 unit, such that price equal :math:`1 / (1 - \pmb{m})`, where :math:`\pmb{m}` represents the array of margins for firms in the sample.
23
23
 
@@ -13,7 +13,7 @@ keywords = [
13
13
  "upward pricing pressure",
14
14
  "GUPPI",
15
15
  ]
16
- version = "2024.739105.2"
16
+ version = "2024.739105.4"
17
17
 
18
18
  # Classifiers list: https://pypi.org/classifiers/
19
19
  classifiers = [
@@ -68,8 +68,8 @@ pendulum = ">=3.0.0"
68
68
  ruff = ">=0.5"
69
69
  poetry-plugin-export = "^1.8.0"
70
70
  pytest = ">=8.0"
71
+ Sphinx = ">=7.2, <8.0"
71
72
  semver = ">=3.0"
72
- sphinx = ">=7.2"
73
73
  sphinx-autodoc-typehints = ">=2.0.0"
74
74
  sphinx-autoapi = ">=3.0"
75
75
  sphinx-immaterial = ">=0.11"
@@ -9,7 +9,7 @@ from numpy.typing import NDArray
9
9
 
10
10
  _PKG_NAME: str = Path(__file__).parent.stem
11
11
 
12
- VERSION = "2024.739105.2"
12
+ VERSION = "2024.739105.4"
13
13
 
14
14
  __version__ = VERSION
15
15
 
@@ -34,6 +34,8 @@ ArrayBoolean: TypeAlias = NDArray[np.bool_]
34
34
  ArrayDouble: TypeAlias = NDArray[np.double]
35
35
  ArrayBIGINT: TypeAlias = NDArray[np.int64]
36
36
 
37
+ DEFAULT_REC_RATE = 0.85
38
+
37
39
 
38
40
  @enum.unique
39
41
  class RECForm(enum.StrEnum):
@@ -13,7 +13,13 @@ import numpy as np
13
13
  from attrs import Attribute, field, frozen, validators
14
14
  from mpmath import mp, mpf # type: ignore
15
15
 
16
- from .. import VERSION, ArrayDouble, RECForm, UPPAggrSelector # noqa: TID252
16
+ from .. import ( # noqa: TID252
17
+ DEFAULT_REC_RATE,
18
+ VERSION,
19
+ ArrayDouble,
20
+ RECForm,
21
+ UPPAggrSelector,
22
+ )
17
23
  from . import guidelines_boundary_functions as gbfn
18
24
 
19
25
  __version__ = VERSION
@@ -86,7 +92,7 @@ class GuidelinesThresholds:
86
92
  """
87
93
 
88
94
  def __attrs_post_init__(self, /) -> None:
89
- # In the 2023 Guidlines, the agencies do not define a
95
+ # In the 2023 Guidelines, the agencies do not define a
90
96
  # negative presumption, or safeharbor. Practically speaking,
91
97
  # given resource constraints and loss aversion, it is likely
92
98
  # that staff only investigates mergers that meet the presumption;
@@ -128,7 +134,7 @@ class GuidelinesThresholds:
128
134
  )
129
135
 
130
136
  # imputed_presumption is relevant for 2010 Guidelines
131
- # merger to symmettry in numbers-equivalent of post-merger HHI
137
+ # merger to symmetry in numbers-equivalent of post-merger HHI
132
138
  object.__setattr__(
133
139
  self,
134
140
  "imputed_presumption",
@@ -262,16 +268,13 @@ class DiversionRatioBoundary:
262
268
  )
263
269
 
264
270
  recapture_rate: float = field(
265
- kw_only=False, default=0.85, validator=validators.instance_of(float)
271
+ kw_only=False, default=DEFAULT_REC_RATE, validator=validators.instance_of(float)
266
272
  )
267
273
 
268
274
  recapture_form: RECForm | None = field(
269
275
  kw_only=True,
270
276
  default=RECForm.INOUT,
271
- validator=(
272
- validators.instance_of((type(None), RECForm)),
273
- _rec_spec_validator,
274
- ),
277
+ validator=(validators.instance_of((type(None), RECForm)), _rec_spec_validator),
275
278
  )
276
279
  """
277
280
  The form of the recapture rate.
@@ -373,7 +376,11 @@ class DiversionRatioBoundary:
373
376
 
374
377
 
375
378
  def guppi_from_delta(
376
- _delta_bound: float = 0.01, /, *, m_star: float = 1.00, r_bar: float = 0.8
379
+ _delta_bound: float = 0.01,
380
+ /,
381
+ *,
382
+ m_star: float = 1.00,
383
+ r_bar: float = DEFAULT_REC_RATE,
377
384
  ) -> float:
378
385
  """
379
386
  Translate ∆HHI bound to GUPPI bound.
@@ -431,7 +438,11 @@ def critical_share_ratio(
431
438
 
432
439
 
433
440
  def share_from_guppi(
434
- _guppi_bound: float = 0.065, /, *, m_star: float = 1.00, r_bar: float = 0.8
441
+ _guppi_bound: float = 0.065,
442
+ /,
443
+ *,
444
+ m_star: float = 1.00,
445
+ r_bar: float = DEFAULT_REC_RATE,
435
446
  ) -> float:
436
447
  """
437
448
  Symmetric-firm share for given GUPPI, margin, and recapture rate.
@@ -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 VERSION, ArrayBIGINT, ArrayDouble # noqa: TID252
8
+ from .. import DEFAULT_REC_RATE, VERSION, ArrayBIGINT, ArrayDouble # noqa: TID252
9
9
 
10
10
  __version__ = VERSION
11
11
 
@@ -211,7 +211,7 @@ def hhi_post_contrib_boundary(
211
211
 
212
212
  def shrratio_boundary_wtd_avg(
213
213
  _delta_star: float = 0.075,
214
- _r_val: float = 0.85,
214
+ _r_val: float = DEFAULT_REC_RATE,
215
215
  /,
216
216
  *,
217
217
  agg_method: Literal[
@@ -420,7 +420,7 @@ def shrratio_boundary_wtd_avg(
420
420
 
421
421
  def shrratio_boundary_xact_avg(
422
422
  _delta_star: float = 0.075,
423
- _r_val: float = 0.85,
423
+ _r_val: float = DEFAULT_REC_RATE,
424
424
  /,
425
425
  *,
426
426
  recapture_form: Literal["inside-out", "proportional"] = "inside-out",
@@ -579,7 +579,7 @@ def shrratio_boundary_xact_avg(
579
579
 
580
580
  def shrratio_boundary_min(
581
581
  _delta_star: float = 0.075,
582
- _r_val: float = 0.85,
582
+ _r_val: float = DEFAULT_REC_RATE,
583
583
  /,
584
584
  *,
585
585
  recapture_form: str = "inside-out",
@@ -645,7 +645,7 @@ def shrratio_boundary_min(
645
645
 
646
646
 
647
647
  def shrratio_boundary_max(
648
- _delta_star: float = 0.075, _r_val: float = 0.85, /, *, prec: int = 10
648
+ _delta_star: float = 0.075, _r_val: float = DEFAULT_REC_RATE, /, *, prec: int = 10
649
649
  ) -> GuidelinesBoundary:
650
650
  """
651
651
  Share combinations on the minimum GUPPI boundary with symmetric
@@ -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 VERSION, ArrayDouble # noqa: TID252
19
+ from .. import DEFAULT_REC_RATE, VERSION, ArrayDouble # noqa: TID252
20
20
  from .guidelines_boundary_functions import (
21
21
  GuidelinesBoundary,
22
22
  _shrratio_boundary_intcpt,
@@ -105,7 +105,7 @@ def hhi_delta_boundary_qdtr(_dh_val: float = 0.01, /) -> GuidelinesBoundaryCalla
105
105
 
106
106
  def shrratio_boundary_qdtr_wtd_avg(
107
107
  _delta_star: float = 0.075,
108
- _r_val: float = 0.85,
108
+ _r_val: float = DEFAULT_REC_RATE,
109
109
  /,
110
110
  *,
111
111
  weighting: Literal["own-share", "cross-product-share"] | None = "own-share",
@@ -224,7 +224,7 @@ def shrratio_boundary_qdtr_wtd_avg(
224
224
 
225
225
  def shrratio_boundary_distance(
226
226
  _delta_star: float = 0.075,
227
- _r_val: float = 0.85,
227
+ _r_val: float = DEFAULT_REC_RATE,
228
228
  /,
229
229
  *,
230
230
  agg_method: Literal["arithmetic mean", "distance"] = "arithmetic mean",
@@ -15,6 +15,7 @@ from attrs import Attribute, cmp_using, field, frozen, validators
15
15
  from numpy.random import SeedSequence
16
16
 
17
17
  from .. import ( # noqa: TID252
18
+ DEFAULT_REC_RATE,
18
19
  VERSION,
19
20
  ArrayBIGINT,
20
21
  ArrayBoolean,
@@ -164,8 +165,8 @@ class ShareSpec:
164
165
  "generated data. Either delete recapture rate specification or set it to None."
165
166
  )
166
167
 
167
- recapture_rate: float | None = field(default=0.8)
168
- """A value between 0 and 1, typically 0.8.
168
+ recapture_rate: float | None = field(default=DEFAULT_REC_RATE)
169
+ """A value between 0 and 1.
169
170
 
170
171
  :code:`None` if market share specification requires direct generation of
171
172
  outside good choice probabilities (:attr:`mergeron.RECForm.OUTIN`).
@@ -276,7 +277,9 @@ class PCMSpec:
276
277
  f'"given value, {_v!r} is ignored."'
277
278
  )
278
279
 
279
- firm2_pcm_constraint: FM2Constraint = field(kw_only=False, default=FM2Constraint.IID)
280
+ firm2_pcm_constraint: FM2Constraint = field(
281
+ kw_only=False, default=FM2Constraint.IID
282
+ )
280
283
  """See :class:`FM2Constraint`"""
281
284
 
282
285
 
@@ -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 VERSION, RECForm # noqa: TID252 # noqa
16
+ from .. import DEFAULT_REC_RATE, 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 (
@@ -73,7 +73,9 @@ class MarketSample:
73
73
 
74
74
  share_spec: ShareSpec = field(
75
75
  kw_only=True,
76
- default=ShareSpec(SHRDistribution.UNI, None, None, RECForm.INOUT, 0.8),
76
+ default=ShareSpec(
77
+ SHRDistribution.UNI, None, None, RECForm.INOUT, DEFAULT_REC_RATE
78
+ ),
77
79
  validator=validators.instance_of(ShareSpec),
78
80
  )
79
81
  """Market-share specification, see :class:`ShareSpec`"""
@@ -11,7 +11,13 @@ import numpy as np
11
11
  from attrs import evolve
12
12
  from numpy.random import SeedSequence
13
13
 
14
- from .. import VERSION, ArrayBIGINT, ArrayDouble, RECForm # noqa: TID252
14
+ from .. import ( # noqa: TID252
15
+ DEFAULT_REC_RATE,
16
+ VERSION,
17
+ ArrayBIGINT,
18
+ ArrayDouble,
19
+ RECForm,
20
+ )
15
21
  from ..core.damodaran_margin_data import mgn_data_resampler # noqa: TID252
16
22
  from ..core.pseudorandom_numbers import ( # noqa: TID252
17
23
  DIST_PARMS_DEFAULT,
@@ -100,7 +106,7 @@ def gen_share_data(
100
106
 
101
107
  # If recapture_form == "inside-out", recalculate _aggregate_purchase_prob
102
108
  _frmshr_array = _mkt_share_sample.mktshr_array[:, :2]
103
- _r_bar = _share_spec.recapture_rate or 0.8
109
+ _r_bar = _share_spec.recapture_rate or DEFAULT_REC_RATE
104
110
  if _recapture_form == RECForm.INOUT:
105
111
  _mkt_share_sample = ShareDataSample(
106
112
  _mkt_share_sample.mktshr_array,
@@ -226,9 +232,7 @@ def gen_market_shares_dirichlet_multimarket(
226
232
  FCOUNT_WTS_DEFAULT if _firm_count_wts is None else _firm_count_wts
227
233
  )
228
234
 
229
- _min_choice_wt = (
230
- 0.03 if _dist_type_dir == SHRDistribution.DIR_FLAT_CONSTR else 0.00
231
- )
235
+ _min_choice_wt = 0.03 if _dist_type_dir == SHRDistribution.DIR_FLAT_CONSTR else 0.00
232
236
  _fcount_keys, _choice_wts = zip(
233
237
  *(
234
238
  _f