Skip to content

Commit

Permalink
REL/DOC: update version
Browse files Browse the repository at this point in the history
- Update version to 1.0
- Remove "beta" warnings
- Reference new paper
- Fix some broken links
  • Loading branch information
jeffgortmaker committed Apr 19, 2023
1 parent f25f595 commit 06fd922
Show file tree
Hide file tree
Showing 29 changed files with 160 additions and 133 deletions.
23 changes: 12 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,21 @@ If you use PyBLP in your research, we ask that you also cite `Conlon and Gortmak
}


If you use PyBLP's micro moments functionality, we ask that you also cite `Conlon and Gortmaker (2023) <https://jeffgortmaker.com/files/micro.pdf>`_, which describes the standardized framework implemented by PyBLP for incorporating micro data into BLP-style estimation.
::

@misc{MicroPyBLP,
author = {Conlon, Christopher and Gortmaker, Jeff},
title = {Incorporating micro data into differentiated products demand estimation with {PyBLP}},
note = {Working paper},
year = {2023}
}


Installation
------------

The PyBLP package has been tested on `Python <https://www.python.org/downloads/>`_ versions 3.6 through 3.9. The `SciPy instructions <https://scipy.org/install/>`_ for installing related packages is a good guide for how to install a scientific Python environment. A good choice is the `Anaconda Distribution <https://www.anaconda.com/products/distribution>`_, since it comes packaged with the following PyBLP dependencies: `NumPy <https://numpy.org/>`_, `SciPy <https://scipy.org/>`_, `SymPy <https://www.sympy.org/en/index.html>`_, and `Patsy <https://patsy.readthedocs.io/en/latest/>`_. For absorption of high dimension fixed effects, PyBLP also depends on its companion package `PyHDFE <https://github.com/jeffgortmaker/pyhdfe>`_, which will be installed when PyBLP is installed.
The PyBLP package has been tested on `Python <https://www.python.org/downloads/>`_ versions 3.6 through 3.9. The `SciPy instructions <https://scipy.org/install/>`_ for installing related packages is a good guide for how to install a scientific Python environment. A good choice is the `Anaconda Distribution <https://www.anaconda.com/download>`_, since it comes packaged with the following PyBLP dependencies: `NumPy <https://numpy.org/>`_, `SciPy <https://scipy.org/>`_, `SymPy <https://www.sympy.org/en/index.html>`_, and `Patsy <https://patsy.readthedocs.io/en/latest/>`_. For absorption of high dimension fixed effects, PyBLP also depends on its companion package `PyHDFE <https://github.com/jeffgortmaker/pyhdfe>`_, which will be installed when PyBLP is installed.

However, PyBLP may not work with old versions of its dependencies. You can update PyBLP's Anaconda dependencies with::

Expand Down Expand Up @@ -147,16 +158,6 @@ Features
- Robust error handling


Features Slated for Future Versions
-----------------------------------

- Fast, "Robust," and Approximately Correct (FRAC) estimation
- Analytic Hessians
- Mathematical Program with Equilibrium Constraints (MPEC)
- Generalized Empirical Likelihood (GEL)
- Discrete types


Bugs and Requests
-----------------

Expand Down
2 changes: 1 addition & 1 deletion docs/background.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ More detailed micro data on individual choices can be used to supplement the sta

.. math:: \bar{g} = \begin{bmatrix} \bar{g}_D \\ \bar{g}_S \\ \bar{g}_M \end{bmatrix}.

Each micro moment :math:`m` is the difference between an observed value :math:`f_m(\bar{v})` and its simulated analogue :math:`f_m(v)`:
:ref:`references:Conlon and Gortmaker (2023)` provides a standardized framework for incorporating micro moments into BLP-style estimation. What follows is a simplified summary of this framework. Each micro moment :math:`m` is the difference between an observed value :math:`f_m(\bar{v})` and its simulated analogue :math:`f_m(v)`:

.. math:: \bar{g}_{M,m} = f_m(\bar{v}) - f_m(v),
:label: micro_moment
Expand Down
3 changes: 3 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
autosectionlabel_prefix_document = True
nbsphinx_prolog = read('templates/nbsphinx_prolog.rst')
nbsphinx_epilog = read('templates/nbsphinx_epilog.rst')
linkcheck_ignore = [
'https://www.anaconda.com/download', # 403 forbidden, but fine in browser
]

# configure HTML information
html_theme = 'sphinx_rtd_theme'
Expand Down
4 changes: 0 additions & 4 deletions docs/introduction.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
Introduction
============

.. note::

This package is in beta. The API may change in future versions. Please use the `GitHub issue tracker <https://github.com/jeffgortmaker/pyblp/issues>`_ to report bugs or to request features.

.. include:: ../README.rst
:start-after: docs-start
4 changes: 2 additions & 2 deletions docs/notebooks/api/build_blp_instruments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -843,7 +843,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/build_differentiation_instruments.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -787,7 +787,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/build_id_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -86,7 +86,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/build_integration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -129,7 +129,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/build_matrix.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -381,7 +381,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/build_ownership.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -206,7 +206,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -440,7 +440,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
8 changes: 5 additions & 3 deletions docs/notebooks/api/data_to_dict.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"metadata": {
"scrolled": true
},
"outputs": [
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -520,7 +522,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/formulation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -151,7 +151,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/integration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -102,7 +102,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/iteration.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -133,7 +133,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions docs/notebooks/api/optimization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -129,7 +129,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions docs/notebooks/api/parallel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -99,7 +99,7 @@
"Starting a pool of 2 processes ...\n",
"Started the process pool after 00:00:00.\n",
"Computing elasticities with respect to prices ...\n",
"Finished after 00:00:03.\n",
"Finished after 00:00:02.\n",
"\n",
"Terminating the pool of 2 processes ...\n",
"Terminated the process pool after 00:00:00.\n"
Expand Down Expand Up @@ -138,7 +138,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
}
},
"nbformat": 4,
Expand Down
24 changes: 12 additions & 12 deletions docs/notebooks/tutorial/blp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
{
"data": {
"text/plain": [
"'0.13.0'"
"'1.0.0'"
]
},
"execution_count": 1,
Expand Down Expand Up @@ -511,14 +511,14 @@
"=======================================================\n",
"\n",
"Formulations:\n",
"=====================================================================================\n",
" Column Indices: 0 1 2 3 4 5 \n",
"----------------------------- -------- --------- ---- -------- ---------- -----\n",
" X1: Linear Characteristics 1 hpwt air mpd space \n",
"X2: Nonlinear Characteristics 1 prices hpwt air mpd space\n",
"X3: Log Cost Characteristics 1 log(hpwt) air log(mpg) log(space) trend\n",
" d: Demographics 1/income \n",
"====================================================================================="
"=======================================================================================\n",
" Column Indices: 0 1 2 3 4 5 \n",
"----------------------------- ---------- --------- ---- -------- ---------- -----\n",
" X1: Linear Characteristics 1 hpwt air mpd space \n",
"X2: Nonlinear Characteristics 1 prices hpwt air mpd space\n",
"X3: Log Cost Characteristics 1 log(hpwt) air log(mpg) log(space) trend\n",
" d: Demographics 1*1/income \n",
"======================================================================================="
]
},
"execution_count": 6,
Expand Down Expand Up @@ -610,20 +610,20 @@
"GMM Objective Projected Reduced Hessian Reduced Hessian Clipped Clipped Weighting Matrix Covariance Matrix\n",
"Step Value Gradient Norm Min Eigenvalue Max Eigenvalue Shares Costs Condition Number Condition Number \n",
"---- --------- ------------- --------------- --------------- ------- ------- ---------------- -----------------\n",
" 2 +5.0E+02 +3.9E-07 +4.9E-01 +5.1E+02 0 0 +4.2E+09 +3.8E+08 \n",
" 2 +5.0E+02 +4.1E-08 +4.9E-01 +5.1E+02 0 0 +4.2E+09 +3.8E+08 \n",
"=======================================================================================================================\n",
"\n",
"Cumulative Statistics:\n",
"===========================================================================\n",
"Computation Optimizer Optimization Objective Fixed Point Contraction\n",
" Time Converged Iterations Evaluations Iterations Evaluations\n",
"----------- --------- ------------ ----------- ----------- -----------\n",
" 00:05:42 Yes 57 131 38231 117300 \n",
" 00:03:29 No 55 112 34229 104904 \n",
"===========================================================================\n",
"\n",
"Nonlinear Coefficient Estimates (Robust SEs Adjusted for 999 Clusters in Parentheses):\n",
"===================================================================================================\n",
"Sigma: 1 prices hpwt air mpd space | Pi: 1/income \n",
"Sigma: 1 prices hpwt air mpd space | Pi: 1*1/income\n",
"------ ---------- -------- ---------- ---------- ---------- ---------- | ------ ----------\n",
" 1 +2.0E+00 | 1 +0.0E+00 \n",
" (+6.1E+00) | \n",
Expand Down
Loading

0 comments on commit 06fd922

Please sign in to comment.