C invert g(.,.,.,.) to calculate x(t,.) C Two capital goods xalp = (x(t-1,1)**alpha(3)) * (x(t-1,2)**alpha(4)) rhs = alpha(1) * psi(t,1) x(t,3) = rhs**(1/alpha(2)) xratio = psi(t,2)/psi(t,1) prod = thed(t) * xalp + alpha(5)*x(t-1,1) $ + alpha(6)*x(t-1,2) x(t,1) = (1/(1+xratio))*(prod - x(t,3)) x(t,2) = prod - x(t,3) - x(t,1) x(t,4) = xratio c ( x(t,2) - x(t-1,2)*alpha(6) )/ c % ( x(t,1) - x(t-1,1)*alpha(5) ) if ( x(t,1).le.0 .or. x(t,2).le.0 ) then write(7,*) x(t,1), x(t,2), x(t,3), thed(t) write(7,*) 'consumption too large' stop endif xlog(t,1) = log(x(t,1)) xlog(t,2) = log(x(t,2)) xlog(t,3) = log(x(t,3)) C calculate the phi to be predicted C 'phi' contains the stuff inside the conditional expectation that C we will try to predict in sbeta if (t.lt.130) goto 10 phi(t-1,1) = rhs * (alpha(3) * thed(t) * xalp / x(t-1,1) + & alpha(5)) phi(t-1,2) = rhs * (alpha(4) * thed(t) * xalp / x(t-1,1) + & alpha(6) * x(t-1,2)/x(t-1,1)) 10 continue