diff --git a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m
index 2e7ad0b599ec1edce32361d8a2cd2817f030b3fa..3b57d45590ea9f5a7b70f08f404bdcba7e9701bc 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_setup.m
@@ -1,6 +1,6 @@
 function perfect_foresight_with_expectation_errors_setup
 
-% Copyright © 2021-2022 Dynare Team
+% Copyright © 2021-2023 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -69,7 +69,7 @@ else
 
     %% Initialize information set at period 1 using “bare” shocks and endval blocks (or initval if there is no endval)
     oo_.pfwee.terminal_info(:, 1) = oo_.exo_steady_state;
-    oo_.pfwee.shocks_info(:, :, 1) = oo_.exo_steady_state;
+    oo_.pfwee.shocks_info(:, :, 1) = repmat(oo_.exo_steady_state, 1, periods);
     for i = 1:length(M_.det_shocks)
         prds = M_.det_shocks(i).periods;
         exo_id = M_.det_shocks(i).exo_id;
diff --git a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m
index fdbdda3ce8c6637f68002c97f3a2a89a241acfed..0e9cd3f26c44c8a3364becdc3cf84c32f1cc67a2 100644
--- a/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m
+++ b/matlab/perfect-foresight-models/perfect_foresight_with_expectation_errors_solver.m
@@ -1,6 +1,6 @@
 function perfect_foresight_with_expectation_errors_solver
 
-% Copyright © 2021-2022 Dynare Team
+% Copyright © 2021-2023 Dynare Team
 %
 % This file is part of Dynare.
 %
@@ -68,7 +68,7 @@ while info_period <= periods
     oo_.endo_simul(:, end-M_.maximum_lead+1:end) = repmat(oo_.steady_state, 1, M_.maximum_lead);
     oo_.exo_simul = exo_simul(info_period:end, :);
     oo_.exo_simul(M_.maximum_lag+(1:periods-info_period+1), :) = oo_.pfwee.shocks_info(:, info_period:end, info_period)';
-    oo_.exo_simul(M_.maximum_lag+periods-info_period+2:end) = repmat(oo_.exo_steady_state, sim_length+M_.maximum_lead-(periods-info_period+1), 1);
+    oo_.exo_simul(M_.maximum_lag+periods-info_period+2:end, :) = repmat(oo_.exo_steady_state', sim_length+M_.maximum_lead-(periods-info_period+1), 1);
 
     options_.periods = sim_length;
 
diff --git a/tests/Makefile.am b/tests/Makefile.am
index b6ed5b9aecf24da38832bb44a0820d17f1e8ddae..ba975f0666208df1e3586b7ff4abbb28e362531d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -398,6 +398,7 @@ MODFILES = \
 	deterministic_simulations/pfwee.mod \
 	deterministic_simulations/pfwee_constant_sim_length.mod \
 	deterministic_simulations/pfwee_learnt_in.mod \
+	deterministic_simulations/pfwee_multiple_shocks.mod \
 	lmmcp/rbc.mod \
 	lmmcp/sw_lmmcp.mod \
 	lmmcp/sw_newton.mod \
diff --git a/tests/deterministic_simulations/pfwee_multiple_shocks.mod b/tests/deterministic_simulations/pfwee_multiple_shocks.mod
new file mode 100644
index 0000000000000000000000000000000000000000..8e5454d79446fb1873a4f26ca15a7c1fcffd382d
--- /dev/null
+++ b/tests/deterministic_simulations/pfwee_multiple_shocks.mod
@@ -0,0 +1,38 @@
+// Test case with several exogenous variables (regression test for #1883)
+
+var c k;
+varexo x y;
+parameters alph gam delt bet aa;
+
+alph=0.5;
+gam=0.5;
+delt=0.02;
+bet=0.05;
+aa=0.5;
+
+model;
+c + k - aa*x*k(-1)^alph - (1-delt)*k(-1) +y;
+c^(-gam) - (1+bet)^(-1)*(aa*alph*x(+1)*k^(alph-1) + 1 - delt)*c(+1)^(-gam);
+end;
+
+initval;
+y=0;
+x = 1;
+k = ((delt+bet)/(1.0*aa*alph))^(1/(alph-1));
+c = aa*k^alph-delt*k;
+end;
+
+steady;
+
+check;
+
+shocks(learnt_in=2);
+  var x;
+  periods 2:3;
+  values 1.2;
+end;
+
+perfect_foresight_with_expectation_errors_setup(periods = 7);
+perfect_foresight_with_expectation_errors_solver;
+
+rplot c;