C Invert g(.,.,.,.) to calculate z(t,.) C rhs = alpha(1)*psi(t,1) z(t,2) = rhs**(1/alpha(2)) xalp = z(t-1,1)**alpha(3) prod = theta(t,1) * xalp + alpha(5) * z(t-1,1) z(t,1) = prod - z(t,2) if ( z(t,1) .lt. 0 ) then write(7,*) 'consumption too large' stop endif zlog(t,1) = log(z(t,1)) C Calculate the phi to be predicted C i.e. the expression inside the conditional expectation that C we try to predict by psi if (t.lt.140) goto 10 phi(t-1,1) = rhs*theta(t,1)*alpha(3)*(xalp/z(t-1,1)) 10 continue