growols.m (240B)
1 % growols.m gr = growols(lny); 2 % Computes least squares growth rates = coefficient from regressing 3 % lny on a time trend (and constant). 4 5 function gr=growols(lny); 6 7 [T N]=size(lny); 8 x=[ones(T,1) (1:T)']; 9 b=inv(x'*x)*x'*lny; 10 gr=(b(2,:))';