Debian Codegraph @

tests/on-the-fly/ex5.mod

raw
1 // --+ options: nostrict +--
2
3 /*
4 ** It is possible to associate an endogenous variable to an equation were the variable does not appear (if it makes sense).
5 */
6
7
8 parameters a0, a1, b0, b1;
9
10 a0 = 1.0;
11 a1 = 0.1;
12 b0 = 0.5;
13 b1 = 0.2;
14
15
16
17 model;
18
19 [endogenous='D']
20 D = a0 - a1*p;
21
22 [endogenous='S']
23 S = b0 + b1*p;
24
25 [endogenous='p']
26 S = D;
27
28 end;
29
30 if ~isequal(length(intersect(M_.endo_names, {'D'; 'S'; 'p'})), 3)
31 error('Endogenous variables are wrong.')
32 end
33
34 if length(M_.exo_names) > 0
35 error('Exogenous variables are wrong.')
36 end