To compute the profile of Marginal Propensity to Consume with the toolkit

Hi Robert, I have a question about how to compute the profile of Marginal Propensity to Consume (MPC) for all ages. To be specific, I try to replicate Figure 12 in Carroll et al. 2017 QE paper “The distribution of wealth and the marginal propensity to consume”. According to Carroll’s available codes, the idea seems to be giving the agent a unit transfer on the right-hand side of the budget constraint. Then compare the age-consumption profile between unit transfer and no transfer, the difference is the MPC. I have tried this idea. The shape of the result looks reasonable. But the value of the “MPC” is very high, that is, the mean of the age-MPC profile I got is close to 1, which is wired. Thanks!

1 Like

Here is an example of computing MPCs that builds on model of Carroll (1997):

Roughly, MPC out of X is defined as \frac{\Delta C}{\Delta X} (e.g. out of wealth, or out of permanent income). [Roughly as we might ideally define it as a derivative, rather than discrete changes, but the way to compute derivatives is anyway to calculate discrete changes]

So if we can calculate consumption at X, and consumption at X+epsilon, then we can compute the MPC out of X as [C(X+epsilon)-C(X)]/[X+epsilon-X].

How exactly to do this in toolkit depends on X. If X directly relates to the grid (e.g. assets) than it is easy enough by getting consumption using ‘ValuesOnGrid’ command. If X does not directly relates to grid you likely need to use ‘ValuesOnGrid’ for both consumption and X.

Note that the MPC will likely take different values all over the state space, so often you want to report it either conditional on some point in the state space (e.g. age, or a specific value of shocks), or you want to report an average MPC (likely taking averages based on the agent distribution).

My example will compute three different MPCs: MPC out of wealth, MPC out of permanent income, MPC out of transitory income. Figure 1 shows MPC as function of assets (at median shocks, for three different ages). Figure 2 shows ‘average MPC’ conditional on age.

All of the above is about theoretical, clean, MPCs. In some situations, you might prefer to use the model to simulate panel data, and then you can run the same regressions on the model data as on the real world data to check you get the same MPCs. This will give you an MPC you can compare with the data, even if that MPC might be a bit messy theoretically (e.g. it might mix the MPC out of permament income with the MPC out of transitory income).

I cannot comment on the values of MPC in Carroll et al (2017), but the value of MPC near 1 that you got is likely incorrect.

Sorry for delayed response, my desktop has been busy the past week or two running some codes for a project.

PS. Permanent shocks are not empirically realistic, you should use persistent shocks instead (autocorrelation at that may be high, but are not equal to one). This Carroll (1997) model is from back when permanent (unit-root) shocks were not yet known to be empirically inferior.

1 Like

Thanks Robert! I was wrong using the discrete changes to calculate MPC. Now I understand this correct way. Really appreciate your detailed answers and example!

1 Like

Hi Robert, thanks to your sample code again. I understand that the permanent shocks in Carroll(1997) model make it impossible to compare with real world data, but I still want to understand how the result in your sample code corresponds to part of the results in his paper. Therefore, I have two questions about comparing the two key results in Carroll (1997) paper to the sample codes.

The first is the Average MPC out of Wealth in Table 1 using the base value of parameters. The value is 0.33. Your Carroll1997 code uses the same values of parameters in the benchmark. But according to the MPC sample code, even if I sum the AvgMPCwealth_age by age (this is a aggregate variable but due to the special way to calculate it, I cannot use the EvalFnOnAgentDist_AggVars_FHorz_Case1 routine to sum it up), the value is 0.19. This value is very far from the value in the paper. I don’t know why.

The second is about last sentence in Page 41 of this paper (the QJE published version), ‘Table I showed that the average MPC out of transitory income is 15 percent or greater in the buffer-stock model …’. It seems like he can calculate the average total MPC out of transitory income (and of course the average total MPC out of persistent income) according to Table 1, but I don’t know how. Connecting it to your MPC sample code, you’ve solved for the AvgMPCpermanentincome_age and AvgMPCtransitorytincome_age at median shocks. If I want to get the similar average MPC out of transitory income he mentioned, should I sum up these two variables at all shocks? Or should I do what you mentioned, simulate the panel data and then run the same regression as on the real world data, in order to compare both the average MPC and then MPC over life-cycle in the model and the data?

Thanks!

The first is the Average MPC out of Wealth in Table 1 using the base value of parameters. The value is 0.33. Your Carroll1997 code uses the same values of parameters in the benchmark. But according to the MPC sample code, even if I sum the AvgMPCwealth_age by age (this is a aggregate variable but due to the special way to calculate it, I cannot use the EvalFnOnAgentDist_AggVars_FHorz_Case1 routine to sum it up), the value is 0.19. This value is very far from the value in the paper. I don’t know why.

One of us presumably has some numerical error [probably mine, he treats the permanent (unit roots) properly by renormalizing them, whereas I just put lot’s of points on them]. I guess try increasing number of grid points (on assets and on shocks)? [Actually, now that I think there is a typo-error in my codes, specifically when you go up one grid point in assets, the increase in wealth is not Delta_a, it is (1+r)Delta_a. I have now corrected this in codes.]

My ‘MPC out of transitory income’ is at the median shock because if you look at line calculating “DeltaC” I only do the calculation at the median, if you just do it for all grid points in that dimension (like I did for assets) and then average over them all, then that will give the ‘average MPC out of transitory income’.

Note that Carroll et al. (2017) has aggregate shocks, so won’t give same answers as Carroll (1997). [You knew this, is for random readers.]

1 Like

Thanks for your reply!

I will try your corrected codes and see the numerical problem.

I see, this confirm my guess. Thanks.

I can understand the difference. Thanks.

PS. Because the MPC is theoretically a derivative, calculating it, like any derivative, is going to be numerically delicate (it is typically much more tricky to numerically approximate derivatives versus integrals).

The intuition for why derivatives are numerically fragile can be seen by thinking about calculus definition of the derivative: \lim_{h \to 0} [f(x+h)-f(x)]/h. The idea is to compute it as [f(x+e)-f(x)]/e for some small e. So ideally we would choose a tiny e, but if we choose e too small then we would run into machine precision errors (roughly, double floating point numbers can have max precision of 10^{-16}). So we want small e to make derivative accurate, but too small causes numerical error; this is unavoidable. [Obviously toolkit is not about to reach e so small as to cause machine precision errors because the discrete grid will cause errors related to small e long before this, but same idea applies of how we want small e to make derivative accurate, but if we pick ‘too small’ an e we will just get numerical error]

This is not to say you cannot compute derivatives accurately —you can— just that they tend to be trickier to compute accurately than other things. Hence why the Carroll (1997) might need more points if you are calculating MPCs (derivatives) than it would need if you were just interested in things like mean age-conditional consumption profiles.

Thanks, Robert. Now I see. Now I’m interested in just the MPCs. So I have to carefully increase the grid points.

If you use ‘divide and conquer’ (I just put a post about it) you can now solve Carroll (1997) both faster and using much larger grids. Easily large enough to get very accurate MPCs :smiley:

[Actually, LifeCycleModel_withze.m is just a lightly edited version of the Carroll (1997) example code. It is identical until you get to the step of solving the value function iteration, and then you can see how to use divide-and-conquer and that it gives the same solution.]

That’s great! Thanks Robert. I test it. It saves half of the running time.

1 Like