function [m,s,G]=growth(X,l);
%GROWTH  Growth rates calculated.
%        [m,s,G]=growth(X,l) calculates the growth rates:
%
%            G(t,i)=100*(X(t,i)-X(t-1,i))/X(t-1,i), t=2,...T   if l=0
%
%        and G(t,i)=100*(log(X(t,i))-log(X(t-1,i))), t=2,...,T if l~=0
%
%        for the ith column of X, i=1,...n, and the means, m, and
%        standard deviations, s, of these growth rates.
%

%        Ellen R. McGrattan,  11-13-87
%
[T,n]=size(X);
if nargin<2; l=0; end;
if l;
  G=100*(log(X(2:T,:))-log(X(1:T-1,:)));
else;
  G=100*(X(2:T,:)-X(1:T-1,:))./X(1:T-1,:);
end;
m=mean(G);
s=std(G);
