Derivative Approximation of Marginal Product
Given the analytical formula for derivative. We can compute the value of the formula at different h.
Cobb-Douglas--Output as a Function of Capital
Let's consider a cobb-douglas production function again.
If you own a firm, you would be very interested in how much additional output you can get from one more unit of capital of one more labor hired. If you know that, you can compare that against the cost of more capital and labor and determine if it is optimal to choose to increase capital and/or labor.
For now, let's fix capital. Suppose capital takes a long time to adjust, but labor can be adjusted. You currently have
and
, what happens to output if you increase labor? % Define Production Function as a function of K, with fixed L
f(L) = (K^alpha)*(L.^beta);
% Graph Production Function with Fixed L
ylabel('Cobb-Douglas Output');
title(['Output with Increasing Labor with fixed Capital=', num2str(K)])
Cobb-Douglas--Tangent line as h gets smaller
Following the definition above, if we want to measure the slope of the output line at
, we need to calculate slope over run as h gets smaller % Define parameters and K0
Y_at_L0 = (K^alpha)*(L0^beta);
% Loop over h, generate a plot for each rise over run as h changes
% Plot as before the production function as a function of K
f(L) = (K^alpha)*(L^beta);
fplot(f, [x_min, x_max], 'LineWidth', 2);
Legend_list{1} = ['Actual Line'];
f_l0 = (K^alpha)*(L0^beta);
f_l0_plus_h = (K^alpha)*((L0+h)^beta);
% Current approximating line slope, based on formula above
cur_slope = (f_l0_plus_h - f_l0)/h;
% Current approximating line y-intercept, we require line to cross (K0, Y_at_K0), and know slope already
cur_y_intercept = Y_at_L0 - cur_slope*L0;
% Plot each of the approximating Slopes
f(L) = cur_y_intercept + cur_slope*L;
fplot(f, [x_min, x_max], '--');
plot([h+L0, h+L0], ylim, '-k');
legend_counter = 1 + legend_counter;
Legend_list{legend_counter} = ['h=' num2str(h) ', slope=' num2str(cur_slope)];
ylabel('Cobb-Douglas Output');
title({'Tangent line as h gets smaller'...
,['Output with Increasing Labor, fixed Capital=' num2str(K)]})
legend(Legend_list,'Location', 'NW','Orientation' ,'Vertical' );
At different h, the approximating slope formula is calculating output per additional worker given h increase in workers. Below are the slopes of the dashed lines in the figure above for a wider range of h values.
% a bigger evenly spaced vector of h
h = linspace(0, 15, h_grid_count);
f_x0 = (K^alpha)*(L0.^beta);
f_x0_plus_h = (K^alpha)*((x0_plus_h).^beta);
% average output per additional worker
f_prime_x0 = (f_x0_plus_h - f_x0)./h;
% Store Results in a Table
T = table(h', x0_plus_h', f_x0_plus_h', f_prime_x0');
T.Properties.VariableNames = {'h', 'x0_plus_h', 'f_x0_plus_h', 'f_prime_x0'};
ylabel('Average output increase per unit of labor increase')
xlabel('h=increases in labor from L=2 (K=1 fixed)')
title('Derivative Approximation as h gets small, CD Production')