Utility Maximization and Intertemporal Consumption
Model Components and Maximization Problem
We can write down the model where we maximize utility over choices : - Utility:
- Budget Today:
- Budget Tomorrow:
We can rewrite the problem as:
Note: the only choice in this model is b, that will determine consumption today and tomorrow.
Note: Does the interest rate have any effects when there are no inheritances in the second period ()? Change the second period inheritances in the code below to analyze the effect of interest rate. Open set for Choice set
Even though the budget constraint seems to allow for 0 consumption today and tomorrow, but log utility is not defined at 0, hence the maximization problem is undefined at and . Hence, the actual choice set for is an open interval: - , (which means 0 and b are not in the domain)
Our Maximization problem is hence:
If you choose save or more, consumption today will be undefined (death today). If you borrow more than endowment tomorrow divided by interest rate, you will not be able to pay back your debts (we assume no default). Given this choice set, we could view this as a constrained maximization problem, but the constraints never bind. Finding Optimal Choices--Brute Force Grid
A brute-force way of solving for this problem is to generate a vectors of values for saving between 0 and b, but not including them, evaluate the utility function at these values, and then find the max. This method works when there are more choices as well. Experiment with the following function by adjusting the parameters, including the discount factor, interest rate, and wealth in the first and second period.
% Generate a Vector of Points
choice_grid_count = 1000;
% This creates 100 equi-distance points, not at 0 and b, but between 0 and b
save_grid = linspace(-wealth_2/(1+r)+0.0001, wealth_1-0.0001, choice_grid_count);
utility_at_savegrid = log(wealth_1 - save_grid) + beta*log(wealth_2 + save_grid*(1+r));
[max_utility, max_utility_index] = max(utility_at_savegrid);
% max_utility is the highest utility onthe choice grid
% out of the choice grid points, which nth choice grid gives highest utility
% we can find the savings level at the index
optimal_savings_choice = save_grid(max_utility_index)
optimal_savings_choice = 4.3868
plot(save_grid, utility_at_savegrid);
scatter(optimal_savings_choice, max_utility, 'filled');
xlabel('Borrow Save Choices along Grid');
ylabel('Utility at different savings choices');
title({'Optimal Borrow Save choice (red dot) on feasible choice grid';...
['optimal Borrow Save = ', num2str(optimal_savings_choice)]});
xlim([-wealth_2/(1+r), wealth_1])
plot(ones(size(save_grid))*0, utility_at_savegrid, 'k--');
Analytical Solution
You can use the symbolic toolbox to take derivative and find root:
funcU = log(z - x) + beta*log((z/2) + x*(1+r))
funcU =
dUdx = diff(funcU, x)
dUdx =
xOpti = solve(dUdx==0, x)
xOpti =
Supply Curve For Capital
With the optimal capital choice as a function of interest rate, we can plot out the supply for capital.
r = linspace(1.0,1.2,grid_points);
% use the . for division because it is a vector divided by another vector
s=(z*beta*(1+r)-(z/2))./((1+r)*(1+beta));
xlabel('Savings (Saved at Bank, to be lent out to firms)');
title({'Inverse Supply For Capital'});