On Thu, 6 Jan 2022, Sven Schreiber wrote:
Am 05.01.2022 um 23:30 schrieb Allin Cottrell:
> On Tue, 4 Jan 2022, ESTEVEZ NUÑEZ JUAN CARLOS wrote:
>
> > Hi Jack,
> > Your code shows any error message with the Windows-32 zip version
> > until 2018/05/11, but it fails with 2018/08/11 zip version, and
> > following. Maybe some was made meanwhile that causes it.
>
> Thanks for this observation!
>
> I'm working on the bug. Following Juan Carlos's observation I diff'd
> the relevant source files between gretl versions 2018s and 2018b. It
> turns out that 2018b introduced a check on the length of the var->B
> coefficient vector (in the function VAR_coeff_matrix_from_VECM in
> irfboot.c), and this check wasn't general enough to validate the
> var->B that results when an EC coefficient is restricted to equal 0.
> The check expected a vector of length 4 but var->B was of length 3,
> omitting the coefficient that was forced to zero.
>
> I'm looking into this question: Should the check should be relaxed
> under the restriction in question, or should var->B be sized as
> expected by the existing check, including an explicit zero entry? I
> suspect the latter is better, but once that's resolved a fix will be
> applied.
Hm, I think that depends on the context. For example, if somewhere in
the code the number of var->B elements is used to determine degrees of
freedom, then adding restricted zero elements would imply trouble, no?
In general it sounds as if adjusting the check would be a more
localized, and thus easier, change.
Would the fix also cover the other issue that jack mentioned, that
$system.coeff is wrong?
After looking further into this, my diagnosis is that var->B (which
provides $system.coeff) has been too small (too few rows) whenever
alpha is restricted: the EC coefficients have been dropped altogether.
So I think the correct fix is to ensure that the EC coeffs get
inserted, in which case the size check for var->B in irfboot.c can be
retained. If df is then wrong (I don't think so but haven't checked
yet) that should be fixed in its own right.
The presence/absence of the EC coeffs in var->B doesn't actually
matter for "fcast" since in that context we use the VAR representation
of the VECM, but it does matter for the completeness of $system.coeff.
At least that's my current understanding.
Allin