Metadata-Version: 2.1
Name: pyblp
Version: 0.5.0
Summary: BLP demand estimation with Python 3
Home-page: https://github.com/jeffgortmaker/pyblp
Author: Jeff Gortmaker
Author-email: jeff@jeffgortmaker.com
License: MIT
Project-URL: Documentation, http://pyblp.readthedocs.io/en/latest
Project-URL: Tracker, https://github.com/jeffgortmaker/pyblp/issues
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.6
Provides-Extra: docs
Provides-Extra: tests
Requires-Dist: numpy (>=1.12.0)
Requires-Dist: patsy (>=0.4.0)
Requires-Dist: scipy (>=1.0.0)
Requires-Dist: sympy (>=1.1.0)
Provides-Extra: docs
Requires-Dist: sphinx; extra == 'docs'
Requires-Dist: pandas; extra == 'docs'
Requires-Dist: ipython; extra == 'docs'
Requires-Dist: matplotlib; extra == 'docs'
Requires-Dist: sphinx-rtd-theme; extra == 'docs'
Provides-Extra: tests
Requires-Dist: pytest; extra == 'tests'
Requires-Dist: pytest-xdist; extra == 'tests'
Requires-Dist: linearmodels; extra == 'tests'

An overview of the model, examples, and other documentation can be found on `Read the Docs <https://pyblp.readthedocs.io/en/stable/>`_.

.. docs-start

The pyblp package is a Python 3 implementation of the nested fixed point algorithm for BLP demand estimation. The author of this package is `Jeff Gortmaker <http://jeffgortmaker.com/>`_. At the moment, the only other contributer is `Chris Conlon <https://chrisconlon.github.io/>`_. Development of the package has been guided by the BLP code made publicly available by many researchers and practitioners. Views expressed in the documentation of this package are those of the contributers and do not necessarily reflect the views of any institution to which they belong.


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

The pyblp package has been tested on `Python <https://www.python.org/downloads/>`_ versions 3.6 and 3.7. The `SciPy instructions <https://scipy.org/install.html>`_ 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, along with many other packages that are useful for scientific computing, it comes packaged with pyblp's only required dependencies: `NumPy <https://www.numpy.org/>`_, `SciPy <https://www.scipy.org/>`_, `SymPy <https://www.sympy.org/en/index.html>`_, and `Patsy <https://patsy.readthedocs.io/en/latest/>`_.

You can install the current release of pyblp with `pip <https://pip.pypa.io/en/latest/>`_::

    pip install pyblp

You can upgrade to a newer release with the ``--upgrade`` flag::

    pip install --upgrade pyblp

If you lack permissions, you can install pyblp in your user directory with the ``--user`` flag::

    pip install --user pyblp

Alternatively, you can download a wheel or source archive from `PyPI <https://pypi.org/project/pyblp/>`_. You can find the latest development code on `GitHub <https://github.com/jeffgortmaker/pyblp/>`_ and the latest development documentation `here <http://pyblp.readthedocs.io/en/latest/>`_.


Features
--------

- Straightforward interface for configuring and solving BLP problems with R-style formulas.
- Performant absorption of arbitrary fixed effects.
- Support for demographics and supply-side moments.
- Support for nonlinear functions and interactions of product characteristics.
- Customizable parameter matrices and bounds.
- Support for nesting parameters that can vary between groups in a full random coefficients nested Logit (RCNL) model.
- Estimation of Logit and nested Logit benchmark models.
- Post-estimation computation of elasticities, diversion ratios, marginal costs, markups, profits, HHI, and consumer surplus.
- Post-estimation merger (or any type of firm ID changes) simulation.
- Flexible interface for simulating synthetic data under Bertrand-Nash competition.
- Optimization with Artleys Knitro, SciPy, or custom routines.
- Fixed point iteration with SQUAREM acceleration or custom routines.
- Integration with Monte Carlo, Gauss-Hermite/Kronrod-Patterson product rules, sparse grids, or custom specifications.
- One-step, two-step, or iterated GMM.
- Support for robust and clustered standard errors.
- Control over weighting matrix computation.
- Linear or log-linear marginal cost specifications.
- Support for non-standard ownership matrices.
- Functions for building custom ownership matrices and BLP instruments.
- Computation of analytic gradients.
- Support for market-by-market parallelization.
- Support for extended floating point precision.
- Robust handling of computational errors.
- Informative and configurable progress updates.


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

- Hessian computation.
- Mathematical Program with Equilibrium Constraints (MPEC) formulation of the GMM objective function.
- Generalized Empirical Likelihood (GEL) formulation of the problem.
- Parametric bootstrap computation of post-estimation standard errors.
- Support for micro moments.
- Built-in IPOPT support.
- Built-in support for more fixed point routines.
- Nonlinear optimization alternatives to fixed point iteration when computing Bertrand-Nash prices and shares.


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

Please use the `GitHub issue tracker <https://github.com/jeffgortmaker/pyblp/issues>`_ to submit bugs or to request features.

