Debian Codegraph @

tests/on-the-fly/ex3.mod

raw
1 // --+ options: nostrict +--
2 /*
3 ** In the following example, we only declare one endogenous variable per equation. Because the other objects are not declared
4 ** they are treated as exogenous variables. An equation tag is used to associate an endogenous variable to each equation.
5 */
6
7 model;
8
9 [endogenous='h']
10 c*theta*h^(1+psi)=(1-alpha)*y;
11
12 [endogenous='k']
13 k = beta*(((exp(b)*c)/(exp(b(+1))*c(+1)))
14 *(exp(b(+1))*alpha*y(+1)+(1-delta)*k));
15
16 [endogenous='y']
17 y = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
18
19 [endogenous='c']
20 k = exp(b)*(y-c)+(1-delta)*k(-1);
21
22 [endogenous='a']
23 a = rho*a(-1)+tau*b(-1) + e;
24
25 [endogenous='b']
26 b = tau*a(-1)+rho*b(-1) + u;
27
28 end;
29
30 if ~isequal(length(intersect(M_.endo_names, {'c'; 'y'; 'k'; 'b'; 'a'; 'h'})), 6)
31 error('Endogenous variables are wrong.')
32 end
33
34 if length(M_.param_names) > 0
35 error('Parameters are wrong.')
36 end
37
38 if ~isequal(length(intersect(M_.exo_names, {'e'; 'u'; 'theta'; 'psi'; 'alpha'; 'beta'; 'delta'; 'rho'; 'tau'})), 9)
39 error('Exogenous variables are wrong.')
40 end