How fast does a Solow economy close the gap to its steady state? Economists often answer with a half-life: the time it takes to close half of the gap. Here you compute it two ways and compare.
The model: output per worker A\,k^{\alpha} with 0 < \alpha < 1, saving rate s, depreciation delta, workforce growth n (fractions), and
with steady state k^* = \left(sA / (\delta + n)\right)^{1/(1-\alpha)}, where f(k^*) = k^*.
The linear prediction. Close to k^*, f is almost a straight line through (k^*, k^*) with slope \rho = f'(k^*), the derivative of f at k^*. Then
so the gap shrinks by the factor \rho every year, and the predicted half-life is the real number h with \rho^{h} = 1/2.
The simulation. Starting from k0, the simulated half-life is the first whole year t \ge 1 in which |k_t - k^*| \le \tfrac{1}{2}\,|k_0 - k^*|.
Write half_life(A, alpha, s, delta, n, k0) that returns a tuple (rho, predicted, simulated). Try starts far below, just below and far above k^*: the prediction is only exact close to the steady state.
Examples
Input: A = 1, alpha = 0.5, s = 0.2, delta = 0.05, n = 0.05, k0 = 3.6
Output: (0.95, 13.51340733, 14)
Explanation: k* = 4 and the gap shrinks by about 5 % a year; 0.95 ** 13.5134 = 0.5.
Starting close to k*, the simulation needs 14 whole years, as predicted.
Input: A = 1, alpha = 0.5, s = 0.2, delta = 0.05, n = 0.05, k0 = 1
Output: (0.95, 13.51340733, 18)
Explanation: far below k*, the gap closes more slowly than the straight line says.
Input: A = 1, alpha = 0.5, s = 0.2, delta = 0.05, n = 0.05, k0 = 9
Output: (0.95, 13.51340733, 12)
Constraints
- answers are compared with a tolerance of
1e-6; do not round
Goals
- Linearise the Solow update rule around its steady state by taking its slope there
- Turn a constant shrink factor into a half-life with logarithms
- Compare the linear prediction with a simulated count, from below and from above