From a08de9e661dbdd9085a3a32ba1d29ea196ec5a21 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Ry=C3=BBk=29?=
 <stepan@adjemian.eu>
Date: Wed, 19 Jan 2022 09:20:22 +0100
Subject: [PATCH] Partial fix for #1837.

---
 matlab/print_expectations.m    | 8 ++++----
 preprocessor                   | 2 +-
 tests/Makefile.am              | 1 +
 tests/pac/var-12/example1.mod  | 6 ------
 tests/pac/var-12/example11.mod | 6 ------
 tests/pac/var-12/example12.mod | 6 ------
 tests/pac/var-12/example13.mod | 6 ------
 tests/pac/var-12/example2.mod  | 6 ------
 8 files changed, 6 insertions(+), 35 deletions(-)

diff --git a/matlab/print_expectations.m b/matlab/print_expectations.m
index d53a3238d8..7663798c34 100644
--- a/matlab/print_expectations.m
+++ b/matlab/print_expectations.m
@@ -379,9 +379,9 @@ if isequal(expectationmodelkind, 'pac') && growth_correction
                             variable = sprintf('%s.lag(%u)', variable, -transformations{k,2});
                         elseif isequal(transformations{k,1}, 'diff')
                             if isempty(transformations{k,2})
-                                variable = sprintf('%s.%s()', variable, transformations{k,1});
+                                variable = sprintf('%s.diff()', variable);
                             else
-                                variable = sprintf('%s(-%u).%s()', variable, transformations{k,2}, transformations{k,1});
+                                variable = sprintf('%s.lag(%u).diff()', variable, transformations{k,2});
                             end
                         else
                             variable = sprintf('%s.%s()', variable, transformations{k});
@@ -440,9 +440,9 @@ if isequal(expectationmodelkind, 'pac') && growth_correction
                                     variable = sprintf('%s.lag(%u)', variable, -transformations{k,2});
                                 elseif isequal(transformations{k,1}, 'diff')
                                     if isempty(transformations{k,2})
-                                        variable = sprintf('%s.%s()', variable, transformations{k,1});
+                                        variable = sprintf('%s.diff()', variable);
                                     else
-                                        variable = sprintf('%s(-%u).%s()', variable, transformations{k,2}, transformations{k,1});
+                                        variable = sprintf('%s.lag(%u).diff()', variable, transformations{k,2});
                                     end
                                 else
                                     variable = sprintf('%s.%s()', variable, transformations{k});
diff --git a/preprocessor b/preprocessor
index 8c528f4f9a..d149d3a76c 160000
--- a/preprocessor
+++ b/preprocessor
@@ -1 +1 @@
-Subproject commit 8c528f4f9a15baf73c014e1c3e55bc13583ca09d
+Subproject commit d149d3a76c7527608e55b7b73b6509dc3b4af097
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 62da3ef47a..750ca5af64 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -531,6 +531,7 @@ ECB_MODFILES = \
 	pac/var-11e/example1.mod \
 	pac/var-12/example1.mod \
 	pac/var-12/example2.mod \
+	pac/var-12/example3.mod \
 	pac/var-12/example4.mod \
 	pac/var-12/example11.mod \
 	pac/var-12/example12.mod \
diff --git a/tests/pac/var-12/example1.mod b/tests/pac/var-12/example1.mod
index 0cb734f268..c5655b7005 100644
--- a/tests/pac/var-12/example1.mod
+++ b/tests/pac/var-12/example1.mod
@@ -58,12 +58,6 @@ model;
 
 end;
 
-shocks;
-  var ex = 1.0;
-  var ey = 1.0;
-  var ez = 1.0;
-end;
-
 // Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
 pac.initialize('pacman');
 
diff --git a/tests/pac/var-12/example11.mod b/tests/pac/var-12/example11.mod
index 68f3a88f3a..fbd4886fa3 100644
--- a/tests/pac/var-12/example11.mod
+++ b/tests/pac/var-12/example11.mod
@@ -39,12 +39,6 @@ model;
 
 end;
 
-shocks;
-  var ex = 1.0;
-  var ey = 1.0;
-  var ez = 1.0;
-end;
-
 // Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
 pac.initialize('pacman');
 
diff --git a/tests/pac/var-12/example12.mod b/tests/pac/var-12/example12.mod
index 9685ef6ee6..d3adfc4fd4 100644
--- a/tests/pac/var-12/example12.mod
+++ b/tests/pac/var-12/example12.mod
@@ -40,12 +40,6 @@ model;
 
 end;
 
-shocks;
-  var ex = 1.0;
-  var ey = 1.0;
-  var ez = 1.0;
-end;
-
 // Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
 pac.initialize('pacman');
 
diff --git a/tests/pac/var-12/example13.mod b/tests/pac/var-12/example13.mod
index ff888b8525..fdb06daaf3 100644
--- a/tests/pac/var-12/example13.mod
+++ b/tests/pac/var-12/example13.mod
@@ -39,12 +39,6 @@ model;
 
 end;
 
-shocks;
-  var ex = 1.0;
-  var ey = 1.0;
-  var ez = 1.0;
-end;
-
 // Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
 pac.initialize('pacman');
 
diff --git a/tests/pac/var-12/example2.mod b/tests/pac/var-12/example2.mod
index b1cdee0838..7a4880cbdd 100644
--- a/tests/pac/var-12/example2.mod
+++ b/tests/pac/var-12/example2.mod
@@ -58,12 +58,6 @@ model;
 
 end;
 
-shocks;
-  var ex = 1.0;
-  var ey = 1.0;
-  var ez = 1.0;
-end;
-
 // Initialize the PAC model (build the Companion VAR representation for the auxiliary model).
 pac.initialize('pacman');
 
-- 
GitLab