Skip to content

Commit

Permalink
DOC: promote tutorial section headers so they show up in the index
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffgortmaker committed Jan 13, 2023
1 parent 96f872b commit fd0e65c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 28 deletions.
15 changes: 5 additions & 10 deletions docs/notebooks/tutorial/blp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this tutorial, we'll use data from :ref:`references:Berry, Levinsohn, and Pakes (1995)` to solve the paper's automobile problem.\n",
"\n",
"\n",
"## Adding a Supply Side with Automobile Data\n",
"\n",
"This tutorial is similar to the [fake cereal tutorial](nevo.ipynb), but exhibits some other features of pyblp:\n",
"In this tutorial, we'll use data from :ref:`references:Berry, Levinsohn, and Pakes (1995)` to solve the paper's automobile problem. This tutorial is similar to the [fake cereal tutorial](nevo.ipynb), but exhibits some other features of pyblp:\n",
"\n",
"- Incorporating a supply side into demand estimation.\n",
"- Allowing for simple price-income demographic effects.\n",
"- Calculating clustered standard errors.\n",
"\n",
"\n",
"### Loading the Data\n",
"## Loading Data\n",
"\n",
"We'll use [pandas](https://pandas.pydata.org/) to load two sets of data:\n",
"\n",
Expand Down Expand Up @@ -418,7 +413,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Setting up the Problem\n",
"## Setting up the Problem\n",
"\n",
"Unlike the fake cereal problem, we won't absorb any fixed effects in the automobile problem, so the linear part of demand $X_1$ has more components. We also need to specify a formula for the random coefficients $X_2$, including a random coefficient on the constant, which captures correlation among all inside goods.\n",
"\n",
Expand Down Expand Up @@ -560,7 +555,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Solving the Problem"
"## Solving the Problem"
]
},
{
Expand Down Expand Up @@ -707,7 +702,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.15"
"version": "3.9.15"
},
"pycharm": {
"stem_cell": {
Expand Down
14 changes: 7 additions & 7 deletions docs/notebooks/tutorial/nevo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Application of Random Coefficients Logit with the Fake Cereal Data\n",
"## Random Coefficients\n",
"\n",
"To include random coefficients we need to add a :class:`Formulation` for the demand-side nonlinear characteristics $X_2$.\n",
"\n",
Expand Down Expand Up @@ -112,7 +112,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Specification of Random Taste Parameters\n",
"## Specification of Random Taste Parameters\n",
"\n",
"It is common to assume that $f(\\beta_i \\mid \\theta)$ follows a multivariate normal distribution, and to break it up into three parts:\n",
"\n",
Expand All @@ -133,7 +133,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Loading the Data\n",
"## Loading Data\n",
"\n",
"The `product_data` argument of :class:`Problem` should be a structured array-like object with fields that store data. Product data can be a structured [NumPy](https://numpy.org/) array, a [pandas](https://pandas.pydata.org/) DataFrame, or other similar objects."
]
Expand Down Expand Up @@ -375,7 +375,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Setting Up and Solving the Problem Without Demographics\n",
"## Setting Up and Solving the Problem Without Demographics\n",
"\n",
"Formulations, product data, and an integration configuration are collectively used to initialize a :class:`Problem`. Once initialized, :meth:`Problem.solve` runs the estimation routine. The arguments to :meth:`Problem.solve` configure how estimation is performed. For example, `optimization` and `iteration` arguments configure the optimization and iteration routines that are used by the outer and inner loops of estimation.\n",
"\n",
Expand Down Expand Up @@ -761,7 +761,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Adding Demographics to the Problem\n",
"## Adding Demographics to the Problem\n",
"\n",
"To add demographic data we need to make two changes:\n",
"\n",
Expand Down Expand Up @@ -1094,7 +1094,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Restricting Parameters\n",
"## Restricting Parameters\n",
"\n",
"Because the interactions between `price`, `income`, and `income_squared` are potentially collinear, we might worry that $\\hat{\\Pi}_{21} = 588$ and $\\hat{\\Pi}_{22} = -30.2$ are pushing the price coefficient in opposite directions. Both are large in magnitude but statistically insignficant. One way of dealing with this is to restrict $\\Pi_{22} = 0$.\n",
"\n",
Expand Down Expand Up @@ -1275,7 +1275,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
"version": "3.9.15"
},
"pycharm": {
"stem_cell": {
Expand Down
17 changes: 6 additions & 11 deletions docs/notebooks/tutorial/petrin.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,10 @@
"id": "7556f474",
"metadata": {},
"source": [
"In this tutorial, we'll use data from :ref:`references:Petrin (2002)` to solve the paper's automobile problem.\n",
"In this tutorial, we'll use data from :ref:`references:Petrin (2002)` to solve the paper's automobile problem. This tutorial is similar to the [first automobile tutorial](blp.ipynb), but exhibits how to incorporate micro moments into estimation.\n",
"\n",
"\n",
"## Adding Micro Moments with Automobile Data\n",
"\n",
"This tutorial is similar to the [first automobile tutorial](blp.ipynb), but exhibits how to incorporate micro moments into estimation.\n",
"\n",
"\n",
"### Loading the Data\n",
"## Loading Data\n",
"\n",
"We'll use [pandas](https://pandas.pydata.org/) to load two sets of data:\n",
"\n",
Expand Down Expand Up @@ -476,7 +471,7 @@
"id": "a04056a2",
"metadata": {},
"source": [
"### Setting up the Problem\n",
"## Setting up the Problem\n",
"\n",
"The problem configuration is based on that of the first automobile problem. It is very similar, with both demand and supply sides, although with a few more product characteristics.\n",
"\n",
Expand Down Expand Up @@ -614,7 +609,7 @@
"id": "fde26d61",
"metadata": {},
"source": [
"### Setting up the Micro Moments"
"## Setting up Micro Moments"
]
},
{
Expand Down Expand Up @@ -1004,7 +999,7 @@
"id": "c8443449",
"metadata": {},
"source": [
"### Solving the Problem\n",
"## Solving the Problem\n",
"\n",
"Like for the first automobile problem, here will will just use the publisehd estimates for $\\Sigma$ and $\\Pi$ starting values."
]
Expand Down Expand Up @@ -1177,7 +1172,7 @@
"id": "8c5db574",
"metadata": {},
"source": [
"### Running the Main Counterfactual\n",
"## Running the Main Counterfactual\n",
"\n",
"One result that is very similar is the paper's headline number: a \\$367.29 million compensating variation from a counterfactual that removes the minivan in 1984. Using our estimates, we get a very similar number.\n",
"\n",
Expand Down

0 comments on commit fd0e65c

Please sign in to comment.