Skip to main content

BLP demand estimation with Python 3

Project description

An overview of the model, examples, and other documentation can be found on Read the Docs.

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. At the moment, the only other contributer is Chris Conlon. 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 versions 3.6 and 3.7. The SciPy instructions for installing related packages is a good guide for how to install a scientific Python environment. A good choice is the Anaconda Distribution, since, along with many other packages that are useful for scientific computing, it comes packaged with pyblp’s only required dependencies: NumPy, SciPy, SymPy, and Patsy.

You can install the current release of pyblp with pip:

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. You can find the latest development code on GitHub and the latest development documentation here.

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 to submit bugs or to request features.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyblp-0.5.0.tar.gz (900.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyblp-0.5.0-py3-none-any.whl (895.1 kB view details)

Uploaded Python 3

File details

Details for the file pyblp-0.5.0.tar.gz.

File metadata

  • Download URL: pyblp-0.5.0.tar.gz
  • Upload date:
  • Size: 900.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyblp-0.5.0.tar.gz
Algorithm Hash digest
SHA256 d84498954f01b8fa8f0cbfcd15d3dd1e2df848acf7178651751c756378d4bbd7
MD5 52c4c737307e481fbb8968f5f8b6a2d6
BLAKE2b-256 30d4d4c4f1a1a041cde845a634723bb5e99830c1c6949b2122ca3af21a7b587e

See more details on using hashes here.

File details

Details for the file pyblp-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: pyblp-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 895.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.6

File hashes

Hashes for pyblp-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 520c493697631e5a2954fa0e93b181e49728f7636f1b5ca11645239201d75fd6
MD5 96dee45201d69514f7691f5b2019abd8
BLAKE2b-256 754b5f8bbbfd044dfd8d06cf08597fe2a6359a4db8d57dacaaa096557fd02232

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page