Poor Household’s Demand for Cheap Dietary Staples

profileJingxue
Firstsetofnote.pdf

Ramses Y. Armendariz, Ph.D. ECON 490: Predictive Analytics

Department of Economics Spring 2020 University of Illinois, Urbana-Champaign

ECON 490: Predictive Analytics

Final Project: Model Estimation

The objective of this project is to estimate a structural model of a poor household demand for dietary staples, test the model against the

data, and use the estimated version of the model to extrapolate some predictions. In these notes, I will explain how to use Excel to

estimate the model; however, you may use any computer language to estimate this model. Later, I will upload notes on how to test the

model against the data and other notes on how to use the model to make predictions.

In this project, we propose that a poor household’s demand for dietary staples follows this Data-Generating Process (DGP):

𝑏 = 𝑖[𝛽𝑝𝑚 − 𝑝𝑏] + 𝑝𝑚𝑝𝑏(1 − 𝛽)𝑐̅

𝑝𝑏(𝑝𝑚 − 𝑝𝑏) + 𝑒

The variables in this model are the following:

• Endogenous variable: quantity demanded for the staple measured in calories (𝑏). • Exogenous variables:

o Price of a calorie from the staple (𝑝𝑏). o Price index of a calorie from all the other sources of food (𝑝𝑚). o Income of the household (𝑖). o Quantity of caloric intake that makes the feeling of hunger become unbearable (𝑐̅). o The importance of satiating hunger in the preferences of the household (𝛽).

• 𝑒 is a random variable. We ignore its probability distribution. All we know is that 𝐸(𝑒) = 0.

Estimation Process

Step 1: Transform the model to match it to the data

From Table 1 in Jensen and Miller (2008, AER), we know that

• average caloric intake per household before the experimental treatment took place was 1,805(2.85) = 5,144.

• the caloric share of the staple before the experimental treatment took place was 0.64.

We are going to use these numbers to calculate the income of the household, 𝑖 = 𝑝𝑏𝑏 + 𝑝𝑚𝑚, according to the economic model proposed in this project. Specifically, we are going to use these numbers to substitute for 𝑏 and 𝑚. After the substitution, we find that the income of the household before the experimental treatment took place is

𝑖 = 𝑝𝑏1,805(2.85)0.64 + 𝑝𝑚1,805(2.85)0.36 = 1,805(2.85)[0.64𝑝𝑏 + 0.36𝑝𝑚]

Now, we can substitute for income in the demand:

𝑏 = 5,144.25(0.64𝑝𝑏 + 0.36𝑝𝑚)[𝛽𝑝𝑚 − 𝑝𝑏] + 𝑝𝑚𝑝𝑏(1 − 𝛽)𝑐̅

𝑝𝑏(𝑝𝑚 − 𝑝𝑏)

Step 2: Choose the moments that the model is going to match

First, we are going to normalize the model in terms of the price of the staple before the experimental treatment was introduced. Thus,

we are going to set the original price of the staple equal to 1 (𝑝𝑏 = 1). Second, we need to find values for the remaining variables in the last equation: 𝑝𝑚, 𝛽, 𝑐̅. Thus, at minimum, we need three moments.

Ramses Y. Armendariz, Ph.D. ECON 490: Predictive Analytics

Department of Economics Spring 2020 University of Illinois, Urbana-Champaign

1. The average consumption of 𝑏 before the experimental policy was introduced.

5,144.25(0.64 + 0.36𝑝𝑚)[𝛽𝑝𝑚 − 1] + 𝑝𝑚(1 − 𝛽)𝑐̅

(𝑝𝑚 − 1) = 2.85(1,805)0.64

2. The average consumption of 𝑏 after its price has increased by 1%.

5,144.25(0.64 + 0.36𝑝𝑚)[𝛽𝑝𝑚 − 1.01] + 𝑝𝑚1.01(1 − 𝛽)𝑐̅

1.01(𝑝𝑚 − 1.01) = 2.85(1,805)0.64(1 + 0.00235)

3. The average consumption of 𝑏 after its price has decreased by 1%.

5,144.25(0.64 + 0.36𝑝𝑚)[𝛽𝑝𝑚 − 0.99] + 𝑝𝑚0.99(1 − 𝛽)𝑐̅

0.99(𝑝𝑚 − 0.99) = 2.85(1,805)0.64(1 − 0.00235)

Notice that the price of the staple in the first moment is equal to 1 (because that is the price we normalized), in the second moment is

equal to 1.01, and in the third moment is equal to 0.99.

The values in the right hand of the equations characterize the ATE that Jensen and Miller (2008, AER) document in Table 3. In

particular, they document that the price elasticity of the staple is + 0.235, making it a Giffen good. 0.00235 is the price elasticity after

it has been divided by 100.

Step 3: Solve the system of equations defined in step 2.

It is necessary to use a computer to approximate numerically the solution to this system of equations. I will explain how to do it using

Excel; however, it can be approximated with other software as well (e.g., Matlab or Python).

To solve this system of equations in Excel, it is necessary to install solver in it. To install solver, follow these instructions:

https://support.office.com/en-us/article/load-the-solver-add-in-in-excel-612926fc-d53b-46b4-872c-

e24772f078ca#OfficeVersion=Windows

Then, create a spreadsheet that looks like this:

Note that this spreadsheet contains four sections: Parameters, Function, Objective, and Population Moments. The section of

Parameters contains the values that the computer will find. Those are the three parameters we are looking for. The section Function

Ramses Y. Armendariz, Ph.D. ECON 490: Predictive Analytics

Department of Economics Spring 2020 University of Illinois, Urbana-Champaign

contains the demand functions that we are going to match to the sample moments. The section objective contains the Objective

function that we are going to make the computer minimize in order to find the values of the parameters. Finally, the section Population

Moments contains the values of the sample moments we want to match.

PARAMETERS

We need to state some initial guesses for all these parameters. These initial guesses will give the computer an initial point to start its

approximation. We want, therefore, to set “educated guesses” rather than just purely arbitrary ones. A good guess will save computing

power. A bad guess, on the other hand, can make the computer approximate a point that is not the solution we are looking for. So, let’s

state the following guesses:

• beta: All we know is that 𝛽 ∈ [0,1], so we should set beta = 0.50, which is half way in between. • c_bar: Average caloric intake per household in the data is 1,805(2.85) = 5,144. Let’s use this number as an initial guess.

• p_m: This price index should be higher than the price of the staple. Thus, let’s guess it is twice the price of the staple: 2.

FUNCTION

In this section, we need to set the functions from Step 2. Specifically, we need to type in cell A12 of the spreadsheet the left hand side

of equation 1 in Step 2. Then, we need to type in cell C12 the left hand side of equation 2. Finally, we need to type in cell B12 the left

hand side of equation 3. Make sure that the 𝛽 from each function is linked to cell A3, the 𝑐̅ from each function is linked to cell B3, and 𝑝𝑚 from each function is linked to cell C3.

POPULATION MOMENTS

• Plug 2.85(1,805)0.64 in cell A17. • Plug 2.85(1,805)0.64(1 − 0.00235) in cell B17. • Plug 2.85(1,805)0.64(1 + 0.00235) in cell C17.

Notice that these are the values of the right hand of the equations from Step 2. Strictly speaking, these values are the sample moments

that Jensen and Miller collected with their experiment. However, I call them Population Moments because the Method of Moments

assumes that they are equal.

OBJECTIVE

In cell G12, we need to type

= (𝐴12 − 𝐴17)2 + (𝐵12 − 𝐵17)2 + (𝐶12 − 𝐶17)2

We are going to ask Solver to minimize this function. This is because the solution to the system of equations that characterize the

method of moments minimizes the value of this function.

After having followed all these steps, the screen should look like this:

Ramses Y. Armendariz, Ph.D. ECON 490: Predictive Analytics

Department of Economics Spring 2020 University of Illinois, Urbana-Champaign

USING SOLVER

1. Click on cell G12. 2. Launch Solver. Solver is located in the Data tab after you have installed it. 3. If you use Excel for Macbook, Solver will look like this:

4. In the box that says “Set Objective,” type “$G$12.” 5. Choose “Min” in the option that says “To:”. 6. In the space that says “By Changing Variable Cells:”, write “Sheet1!$A$3:$C$3.” 7. In the section for constraints, you will add 6 constraints. For each constraint, you need to click the add button.

a. Cell Reference: “Sheet1!$A$3.” Then, choose “>=”. Then, in Constraint write “0”. Finally, click “Add.” b. Cell Reference: “Sheet1!$A$3.” Then, choose “<=”. Then, in Constraint write “1”. Finally, click “Add.” c. Cell Reference: “Sheet1!$B$3.” Then, choose “>=”. Then, in Constraint write “0”. Finally, click “Add.” d. Cell Reference: “Sheet1!$B$3.” Then, choose “<=”. Then, in Constraint write “10000”. Finally, click “Add.” e. Cell Reference: “Sheet1!$C$3.” Then, choose “>=”. Then, in Constraint write “1.5”. Finally, click “Add.” f. Cell Reference: “Sheet1!$C$3.” Then, choose “<=”. Then, in Constraint write “4”. Finally, click “OK.”

8. In “Select a Solving Method” choose “GRG Nonlinear.” 9. Click “Solve.”

After point 8., the screen from solver should look like this:

Ramses Y. Armendariz, Ph.D. ECON 490: Predictive Analytics

Department of Economics Spring 2020 University of Illinois, Urbana-Champaign

And, after point nine, the spread sheet should look very similar to this:

ESTIMATED VALUES

The estimated values of the parameters are �̂� = 0.059, 𝑐̅̂ = 4,951.367, �̂�𝑚 = 2.655. Notice that the values that are approximated may change slightly each time we approximate. Thus, the estimated version of our model is the following:

𝑏(𝑝𝑏; 𝑝𝑚, 𝑖) = 𝑖[0.059𝑝𝑚 − 𝑝𝑏] + 𝑝𝑚𝑝𝑏(0.941)4,951.367

𝑝𝑏(𝑝𝑚 − 𝑝𝑏)

Or, we can also present the demand model in terms of the price of the staple only:

𝑏(𝑝𝑏) = 8,209.194[0.156 − 𝑝𝑏] + 12,370.272𝑝𝑏

𝑝𝑏(2.655 − 𝑝𝑏)

In this later estimated version of the model, I substituted for the income using this formula: 𝑖 = 𝑝𝑏𝑏 + 𝑝𝑚𝑚, where the value of 𝑏 is 2.85(1,805)0.64, the value of 𝑚 is 2.85(1,805)0.36, the value of 𝑝𝑚 is 2.655, and the value of 𝑝𝑏 is 1. When you substitute all these numbers, you find that 𝒊 = 𝟖, 𝟐𝟎𝟗. 𝟏𝟗𝟒. This is the average real income of a household in the experiment. This real income is measured in terms of staple calories. This is one of the main results of this estimation process. It provides an alternative technique to

measure real income in terms of nutrition.

Talking about the results

The numerical approximation found the values of 𝛽, 𝑐̅, and 𝑝𝑚 such that it made the prediction of the model be equal to the sample moments. This can be seen by comparing the screen shot of the spread sheet before we used Solver with the screen shot of after. In the

screen shot before we used solver, the predicted values of the model were around 5,000 calories. These numbers are shown in the section

FUNCTION of the spreadsheet. On the other hand, the values of the sample moments (those are the values in the section POPULATION

MOMENTS) are around 3,300. Therefore, the prediction of the model was not close to the numbers reported by the data. In the screen

shot after we used solver, the predicted values almost matched those values of the sample moments. That is, solver found the values of

the parameters that make the model predict the values reported by the data.

Now, you have an estimated structural model of a poor household’s demand for dietary staples ready to be used to make active

predictions! Notice that this model is not linear, which makes it impossible for us to employ the estimation techniques we have learned

for linear DGPs.