| 1 |
/* Tests for model-local variables |
| 2 |
(including in params derivs file, i.e. with identification, see Dynare/preprocessor#13) |
| 3 |
Also tests the possibility of having a lead/lag on a model-local variable |
| 4 |
(recursively in the definition of another such variable) (see #1929) |
| 5 |
*/ |
| 6 |
|
| 7 |
var c, y, k, a, h, b; |
| 8 |
varexo e, u; |
| 9 |
|
| 10 |
parameters beta, rho, alpha, delta, theta, psi, tau; |
| 11 |
|
| 12 |
alpha = 0.36; |
| 13 |
rho = 0.95; |
| 14 |
tau = 0.025; |
| 15 |
beta = 0.99; |
| 16 |
delta = 0.025; |
| 17 |
psi = 0; |
| 18 |
theta = 2.95; |
| 19 |
|
| 20 |
phi = 0.1; |
| 21 |
|
| 22 |
/* The following statement is a regression test for #1782. |
| 23 |
Here the “foo” variable definition depends on “bar”, but the symbol ID of |
| 24 |
“foo” will be smaller than the symbol ID of “bar”. */ |
| 25 |
model_local_variable foo $\text{foo}$; |
| 26 |
|
| 27 |
model; |
| 28 |
#bar = exp(b(+1))*c(+1); |
| 29 |
#foo = bar(-1)/(exp(b(+1))*c(+1)); |
| 30 |
c*theta*h^(1+psi)=(1-alpha)*y; |
| 31 |
k = beta*(foo |
| 32 |
*(exp(b(+1))*alpha*y(+1)+(1-delta)*k)); |
| 33 |
y = exp(a)*(k(-1)^alpha)*(h^(1-alpha)); |
| 34 |
k = exp(b)*(y-c)+(1-delta)*k(-1); |
| 35 |
a = rho*a(-1)+tau*b(-1) + e; |
| 36 |
b = tau*a(-1)+rho*b(-1) + u; |
| 37 |
end; |
| 38 |
|
| 39 |
initval; |
| 40 |
y = 1.08068253095672; |
| 41 |
c = 0.80359242014163; |
| 42 |
h = 0.29175631001732; |
| 43 |
k = 11.08360443260358; |
| 44 |
a = 0; |
| 45 |
b = 0; |
| 46 |
e = 0; |
| 47 |
u = 0; |
| 48 |
end; |
| 49 |
|
| 50 |
shocks; |
| 51 |
var e; stderr 0.009; |
| 52 |
var u; stderr 0.009; |
| 53 |
var e, u = phi*0.009*0.009; |
| 54 |
end; |
| 55 |
|
| 56 |
steady; |
| 57 |
check; |
| 58 |
stoch_simul; |
| 59 |
|
| 60 |
varobs c; |
| 61 |
|
| 62 |
identification(parameter_set=calibration); |