/* -------------------------------------------------------------------------- */ /* proc makeik Usage: ik = makeik(delta,i); Inputs: delta = depreciation rate (e.g., .01); may be a column vector i = investment series in levels; may be a time-series matrix. Ouput: ik = investment/capital ratio, conformable to i. Note: Accumulation is k(t+1) = (1-delta)(k(t) + i(t)) Starts with ik[1] = E(i(t+1)/i(t)) / (1-delta) -1. This is the steady state with constant investment growth at its mean */ /* ------------------------------------------------------------------------- */ proc(1) = makeik(delta,i); local ik,j,T; T = rows(i); ik = zeros(rows(i),cols(i)); ik[1,.] = meanc(i[2:T,.] ./ i[1:T-1,.])' ./ (1-delta') - 1 ; j = 2; do while j <= T; ik[j,.] = i[j,.]./i[j-1,.] .* ik[j-1,.] ./ ( (1-delta') .* (1+ik[j-1,.]) ); j = j+1; endo; retp(ik); endp;