It's deterministic in the sense that the run is completely unanticipated, so I understand now that the initval-endval construct should work. Below is a portion of the code (I realize everything below is in logs but I will get rid of those later).
- Code: Select all
//EQUATIONS 1
exp(A) = exp(N) + exp(D) - exp(Q)*exp(S);
exp(lam) = exp(mu)/(theta*(1 - exp(om)) - exp(mu));
exp(N) = (sig + xi)*((exp(Z)+(1-del)*exp(Q))*exp(S(-1)) + exp(Ra(-1))*exp(A(-1))) - sig*exp(R(-1))*exp(D(-1));
exp(Om) = 1 - sig + sig*(exp(Va)*(1 + exp(lam)) - theta*exp(om)*exp(lam));
exp(lam) = (exp(Va) - exp(V))*(1 + exp(lam))/(theta*exp(om));
exp(Q)*exp(S) = ((theta*exp(om)+exp(V)-exp(Va))*exp(D)+(theta*exp(om)-exp(Va))*exp(N))/(exp(mu)-theta*(1-exp(om)));
exp(mu) = exp(SDF(+1))*exp(Om(+1))*(exp(Rs(+1)) - exp(Ra));
exp(Va) = exp(SDF(+1))*exp(Om(+1))*exp(Ra);
exp(V) = exp(SDF(+1))*exp(Om(+1))*exp(R);
exp(Lev) = (exp(Q(-1))*exp(S(-1))*exp(Rs)+exp(Ra(-1))*exp(A(-1)))/(exp(Q(-1))*exp(S(-1))*exp(Rs)+exp(Ra(-1))*exp(A(-1))-exp(R(-1))*exp(D(-1)));
//EQUATIONS 2
exp(Aprime) = exp(Q)*exp(Sprime) - exp(Nprime);
exp(lamprime) = exp(muprime)/(exp(phi) - exp(muprime));
exp(Nprime) = (sig + xiprime)*(exp(Z)+(1-del)*exp(Q))*exp(Sprime(-1)) - sig*exp(Ra(-1))*exp(Aprime(-1));
exp(Omprime) = 1 - sig + sig*(1 + exp(lamprime))*exp(Vaprime);
exp(muprime) = exp(phi) - (exp(Vaprime)*exp(Nprime))/(exp(Q)*exp(Sprime));
exp(muprime) = exp(SDF(+1))*exp(Omprime(+1))*(exp(Rs(+1)) - exp(Ra));
exp(Vaprime) = exp(SDF(+1))*exp(Omprime(+1))*exp(Ra);
exp(Levprime) = (exp(Q(-1))*exp(Sprime(-1))*exp(Rs))/(exp(Q(-1))*exp(Sprime(-1))*exp(Rs)-exp(Ra(-1))*exp(Aprime(-1)));
//EQUATIONS 3
exp(K) = exp(S) + exp(Sprime);
exp(A) = exp(Aprime);
In the original SS (before the run), all of these equations hold. To understand what I'm doing, everything in the EQUATIONS 1 block denotes equations for bank 1, anything in EQUATIONS 2 is for bank 2, and the final block is market clearing. Also, S, A, N, D are bank 1 balance sheet terms and Sprime, Aprime, Nprime are bank 2 balance sheet terms. Pre-run, both banks exist so all of these terms are nonzero. Post-run, bank 2 disappears so Sprime = Aprime = Nprime = 0. A run will occur under conditions I specified in a previous post.