From 949387c82b84b8248654cb323a1a702674d4bb84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?= Date: Fri, 9 Feb 2018 15:15:55 +0100 Subject: [PATCH] Added a model with VAR and PAC equation. --- examples/1/clean | 5 +++++ examples/1/example.mod | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100755 examples/1/clean create mode 100644 examples/1/example.mod diff --git a/examples/1/clean b/examples/1/clean new file mode 100755 index 000000000..3cae8a7a8 --- /dev/null +++ b/examples/1/clean @@ -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 diff --git a/examples/1/example.mod b/examples/1/example.mod new file mode 100644 index 000000000..2c51d8e7e --- /dev/null +++ b/examples/1/example.mod @@ -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'); \ No newline at end of file