From 31ba42e2118e11cf1b7f02cb6d9516ca1a476faa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Adjemian=20=28Charybdis=29?=
 <stepan@adjemian.eu>
Date: Tue, 7 Sep 2021 18:39:52 +0200
Subject: [PATCH] Apply patch from d440b7082 for (VAR based) expectations in
 PAC.

Fix the computation of h1 and h0 if the auxiliary model (VAR) has a constant.

(cherry picked from commit f1bf12c60161eabdbe9d46a2a604eb425cebd6a6)
---
 matlab/+pac/+update/parameters.m | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/matlab/+pac/+update/parameters.m b/matlab/+pac/+update/parameters.m
index 8404d42e68..226ddfc1f9 100644
--- a/matlab/+pac/+update/parameters.m
+++ b/matlab/+pac/+update/parameters.m
@@ -110,9 +110,15 @@ for e=1:number_of_pac_eq
         if varmodel.nonstationary(id)
             idns = id;
             ids = [];
+            if varmodel.isconstant
+                idns = idns+1;
+            end
         else
             idns = [];
             ids = id;
+            if varmodel.isconstant
+                ids = ids+1;
+            end
         end
     else
         % Trend component model is assumed.
-- 
GitLab