 ## Sunday, June 20, 2010

On a bet and with 7 minutes to spare, I post a model which has a business cycle due to inter-industry wage differentials. Aside from that the model is a standard Ramsey Cass Koopmans growth model without grown.

This is a Gauss program. It shows a dynamically stable steady state so eqilibrium is indeterminate. That is, a sunspot can affect real variables.

Over the cycle, employment, consumption and investment are positively correlated. There is a procyclical real wage even though technology is constant.

It's reasonably likely that if I try to translate this program from Gauss into English, I will find that I didn't program what I meant to program, so I will have to invent a new story to argue that it is what I meant. But it does have fun dynamics.

All parameter values are extremely unrealistic.

This is a model. Any similarities to actual business cycles in a real world economy are purely coincidental.

/* business cycles due to inter-industry wage differentials ?
Now with elastic labor supply. u=ln(c) -L, L supply based on average wage.
the lo function is to be viewed with extreme suspicion*/

bet = 2;
alpha1 = 0.69;
alpha2 = 0.7;
delta = 0.05;
sigma = 1;
rho = 0.05;
eps = 0.000001;

k1=1;
k = 2;

gam = bet*alpha2*(1-alpha1)/(alpha1*(1-alpha2));

/*three useful functions. lo is employment in the capital goods sector, kdot is growth of total capital
and l2 is employment in the consumption goods sector*/

theta = 1/(1-alpha2*(1-sigma));

fn l2(k1,k) = alpha2*(((bet*k1+gam*(k-k1))/(k1+gam*(k-k1)))^theta)*(k-k1)^(1-sigma*theta);
fn lo(k1,k) = l2(k1,k)*k1/((k-k1)*gam);

fn kdot(k1,k) = (lo(k1,k))^alpha1*k1^(1-alpha1)-delta*k;

eta = ((rho+delta)/(1-alpha1))^(1/alpha1); /*l1ss/k1ss */
zeta = (rho+alpha1*delta)/(delta*(1-alpha1)); /*k2ss/k1ss */

k2ss = (((bet+gam*zeta)/(1+gam*zeta))^(1/sigma))*(eta*gam/alpha2)^(-1/(sigma*theta));
k1ss = k2ss/zeta;
kss = k1ss*(1+zeta);

"r u ok ?"

(lo(k1ss,kss)/k1ss)-eta "=0?";

/*I will do everything in ldot numerically as it is a hassle*/

fn dllodk1(k1,k) = (lo(k1+eps,k)-lo(k1,k))/(lo(k1,k)*eps);
fn dllodk(k1,k) = (lo(k1,k+eps)-lo(k1,k))/(lo(k1,k)*eps);
fn dll2dk1(k1,k) = (l2(k1+eps,k)-l2(k1,k))/(l2(k1,k)*eps);
fn dll2dk(k1,k) = (l2(k1,k+eps)-l2(k1,k))/(l2(k1,k)*eps);

dllodk1(k1ss,kss) dllodk(k1ss,kss);

fn den(k1,k) =
(alpha2-alpha1)*((1/k1)-dllodk1(k1,k)) + sigma*(1-alpha2)/(k-k1)-sigma*alpha2*dll2dk1(k1,k);

fn num(k1,k) = delta+rho -
(1-alpha1)*(lo(k1,k)/k1)^alpha1+
((sigma*(1-alpha2)/(k-k1))-alpha2*sigma*dll2dk(k1,k)+(alpha2-alpha1)*dllodk(k1,k))*kdot(k1,k);

fn k1dot(k1,k) = num(k1,k)/den(k1,k);

/*check steady state k1dot and kdot should be 0*/
"k1dot" k1dot(k1ss,kss) "kdot" kdot(k1ss,kss);

/*make derivative matrix*/
dm=zeros(2,2);

dm[1,1] = k1dot(k1ss+eps,kss)/eps;
dm[1,2] = k1dot(k1ss,kss+eps)/eps;
dm[2,1] = kdot(k1ss+eps,kss)/eps;
dm[2,2] = kdot(k1ss,kss+eps)/eps;

"dm";
dm;

"det dm" det(dm);

"eigenvalues";
eig(dm);

"kss k1ss";
kss k1ss;

k1 = k1ss;
k = kss+150000*eps;

tser = (k|k1)';

"simulate";
step = 0.1;
ii=0;
"employment wage invest cons";
do while ii <100;
ii=ii+1;
k2 = k-k1;
l1 = lo(k1,k);
ltwo = l2(k1,k);

l = l1+ltwo;
w = (l1*bet + ltwo)*alpha2*((k2/ltwo)^(1-alpha2))/(l1+ltwo);
invest = (l1^alpha1)*k1^(1-alpha1);
c = (ltwo^alpha2)*k2^(1-alpha2);
l w invest c;

k1 = k1+step*k1dot(k1,k);
k = k+step*kdot(k1,k);
kk1 = (k|k1)';
tser = tser|kk1;
endo;