FRAC estimation for macro-BLP models
Project description
frac_blp
FRAC for macro-BLP (Salanie-Wolak).
- Github repository: https://github.com/bsalanie/frac-blp/
- Documentation https://bsalanie.github.io/frac-blp/
Overview
The package estimates a second-order approximation to the macro BLP model with random coefficients using the FRAC method of Salanie and Wolak.
At this early stage, the package only implements the basic version of the model without demographics.
The user should be familiar with the macro BLP model (Berry, Levinsohn, and Pakes, 1995). We use very similar notation to that of Conlon and Gortmaker in their pyblp package:
The inputs are:
T: the number of marketsJ: the number of products per marketX1: variables with fixed coefficients, an(N=T*J, n1)matrixX2: variables with random coefficients, an(N, n2)matrixZ: instruments, an(N, nz)matrix.
The outputs are:
betas: the coefficients on the variables with fixed coefficients and the mean coefficients on the variables with random coefficients, an(n1 + n2)vectorsigmas: the standard deviations of the coefficients on the variables with random coefficients, ann2vector.
entering the data
The user must provide the data as numpy arrays with T*J rows:
-
X1_exo, X1_endo, X2_exo, X2_endo: matrices of exogenous and endogenous variables with fixed and random coefficients -
Z: matrix of instruments -
shares: vector of market shares.
The observations should be ordered by market, i.e., the first J rows correspond to market 1, the next J rows to market 2, etc.
These are entered in the model as follows:
rom frac blp.frac classes import FracNodemogRealData
frac data = FracNodemogRealData(T, J,
X1_exo, X1_endo,
X2_exo, X2_endo,
Z, shares,
names_vars_beta,
names_vars_sigma)
Then the model can be estimated with:
from frac_blp.frac_nodemog import estimate
betabar, sigmas = frac nodemog estimate(frac data)
Release notes
0.2 (October 27, 2025)
Improved README.
0.1 (October 26, 2025)
First working version, no demographics.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file frac_blp-0.2.0.tar.gz.
File metadata
- Download URL: frac_blp-0.2.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1a1564632fa266fc1d79ee63438dba43a01eed4ea01e2256679179d6f7a8ef5
|
|
| MD5 |
e3401291f625faa4ce21ee61cf8c14a7
|
|
| BLAKE2b-256 |
d82a7cc4feaec96a4050424caaea42ee4d83e059fec9c65b69a9c1092f1c517a
|
File details
Details for the file frac_blp-0.2.0-py3-none-any.whl.
File metadata
- Download URL: frac_blp-0.2.0-py3-none-any.whl
- Upload date:
- Size: 9.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9007032740bdcba203d879a0193c3c6e65711befbf508752baf3b9cc59e7250f
|
|
| MD5 |
e567fdb6ac3b7f0f95ab14a5ff42cc31
|
|
| BLAKE2b-256 |
81228eb87e3488347ab261f0a8dc43b1d475b50db7386faeef2222d5928e3d81
|