Debian Codegraph @

tests/on-the-fly/ex2.mod

raw
1 // --+ options: nostrict +--
2 /*
3 ** Same as ex1.mod without the first equation -> h is an exogenous variable, psi is not a model object (because it
4 ** is not used in the remaining equations), and theta is an exogenous equation (see the last equation).
5 */
6
7 model;
8 //c*theta|p*h|e^(1+psi|p)=(1-alpha)*y;
9 k|e = beta|p*(((exp(b)*c)/(exp(b(+1))*c(+1)))
10 *(exp(b(+1))*alpha|p*y(+1)+(1-delta)*k));
11 y|e = exp(a)*(k(-1)^alpha)*(h^(1-alpha));
12 k = exp(b)*(y-c|e)+(1-delta|p)*k(-1);
13 a|e = rho|p*a(-1)+tau*b(-1) + e|x;
14 b|e = tau|p*a(-1)+rho*b(-1) + u|x + .0*theta; // The last term is here just for testing purpose.
15 end;
16
17 alpha = 0.36;
18 rho = 0.95;
19 tau = 0.025;
20 beta = 0.99;
21 delta = 0.025;
22 psi = 0;
23 // If the following line is uncommented, this will trigger an error from the preprocessor
24 // because it is not allowed to give a value to an exogenous variable.
25 //theta = 2.95;
26 phi = 0.1;
27
28 if ~isequal(length(intersect(M_.endo_names, {'c'; 'y'; 'k'; 'b'; 'a'})), 5)
29 error('Endogenous variables are wrong.')
30 end
31
32 if ~isequal(length(intersect(M_.param_names, {'alpha'; 'beta'; 'delta'; 'rho'; 'tau'})), 5)
33 error('Parameters are wrong.')
34 end
35
36 if ~isequal(length(intersect(M_.exo_names, {'e'; 'u'; 'h'; 'theta'})), 4)
37 error('Exogenous variables are wrong.')
38 end