Added a model with VAR and PAC equation.

time-shift
Stéphane Adjemian (Charybdis) 2018-02-09 15:15:55 +01:00
parent ab1c24d853
commit 949387c82b
2 changed files with 44 additions and 0 deletions

5
examples/1/clean Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
rm -rf example
rm -f example_dynamic.json example.json example.m example_original.json example_static.json
rm -f example_dynamic.m example.log example_set_auxiliary_variables.m example_static.m

39
examples/1/example.mod Normal file
View File

@ -0,0 +1,39 @@
// --+ options: json=compute +--
var y x z;
varexo ex ey ez;
parameters a_y_1 a_y_2 b_y_1 b_y_2 b_x_1 b_x_2 ; // VAR parameters
parameters beta g e_c_m c_z_1 c_z_2; // PAC equation parameters
a_y_1 = .2;
a_y_2 = .3;
b_y_1 = .1;
b_y_2 = .4;
b_x_1 = -.1;
b_x_2 = -.2;
g = .0;
beta = .9;
e_c_m = .1;
c_z_1 = .7;
c_z_2 = -.3;
var_model(model_name=toto, eqtags=['eq:x', 'eq:y']);
model;
[name='eq:y']
y = a_y_1*y(-1) + a_y_2*diff(x(-1)) + b_y_1*y(-2) + b_y_2*diff(x(-2)) + ey ;
[name='eq:x']
diff(x) = b_x_1*y(-2) + b_x_2*diff(x(-1)) + ez ;
[name='eq:pac']
diff(z) = e_c_m*(x(-1)-z(-1)) + c_z_1*diff(z(-1)) + c_z_2*diff(z(-2)) + pac_expectation(model_name=pacman, var_model_name=toto, discount=beta, growth=g) + ez;
end;
get_companion_matrix('toto');