File: ramst_model_edit.mod

package info (click to toggle)
dynare 6.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 67,796 kB
  • sloc: cpp: 79,110; ansic: 28,917; objc: 12,445; yacc: 4,537; pascal: 1,993; lex: 1,441; sh: 1,132; python: 634; makefile: 628; lisp: 163; xml: 18
file content (64 lines) | stat: -rw-r--r-- 1,376 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/* Test for multiple model blocks, model_remove, model_options and var_remove commands,
   and model_replace block.
   It should give the same results as ramst.mod. */

var c k;
varexo x;

var dummy1 dummy2 dummy3;

parameters alph gam delt bet aa;
alph=0.5;
gam=0.5;
delt=0.02;
bet=0.05;
aa=0.5;

model;
  [ name = 'ressource constraint' ]
  c + k = aa*x*k(-1)^alph;
end;

model;
  [ name = 'eq:dummy1', endogenous = 'dummy1' ]
  dummy1 = c + 1;
  [ foo = 'eq:dummy2' ] // Since dummy2 is alone on the LHS, it is considered as the variable set by this equation
  log(dummy2) = k + 2;
  [ name = 'eq:dummy3', bar = 'baz' ]
  c(+1) = c;
end;

model_options(block);

model_remove('eq:dummy1', foo = 'eq:dummy2');

model_replace('ressource constraint', [ name = 'eq:dummy3', bar = 'baz' ]);
  c + k - aa*x*k(-1)^alph - (1-delt)*k(-1);
  c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
end;

var_remove dummy3;

initval;
x = 1;
k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
c = aa*k^alph-delt*k;
end;

steady;

check;

shocks;
var x;
periods 1;
values 1.2;
end;

perfect_foresight_setup(periods=200);
perfect_foresight_solver;

S = load('../deterministic_simulations/ramst/Output/ramst_results.mat');
if any(size(oo_.endo_simul) ~= size(S.oo_.endo_simul)) || any(any(abs(oo_.endo_simul - S.oo_.endo_simul) > 1e-10))
  error('Model editing failure')
end