On Tue, 3 Jul 2018, Sven Schreiber wrote:
Am 03.07.2018 um 02:35 schrieb Allin Cottrell:
>
> Quick diagnosis: In cases 2 and 4 the function SVAR_coint is exiting early
> on error, because jbeta has 5 rows and the function thinks it ought to have
> 6. So on exit the "SVARobj" has not been filled with the required matrices.
> Then when we get to the function vecm_est, jbeta is 0 x 0 and the attempt
> to extract a non-null submatrix necessarily fails ("Index value 1 is out of
> bounds").
Hi Allin, I don't think this is what the (original) error is about, or I'm
not following you. Could it be that you used the test script but didn't
change the --uc option in the vecm line when you chose cases 2 or 4?
Yes, that's exactly what I did. So it seems I'm not talking about the
original error. Nonetheless, this too seems like an error condition
that merits attention.
> I've taken the liberty of making SVAR_coint fail with an
error message (in
> git) if jbeta is deemed not to be of the correct dimensions. Of course feel
> free to revert that, but it seems some more error-reporting is needed.
More error reporting is always good!
Before I made that change in git, SVAR_coint just silently returned
non-zero on error. On a quick inspection of the SVAR doc, I don't
think it's clear that the user has to check for non-zero return values
from SVAR functions (on pain of getting incomprehensible errors from
subsequent function calls). In fact, the alphabetical listing of SVAR
functions doesn't mention their return types.
I'd suggest that you and Jack consider using "funcerr" wherever
relevant. Of course the design choice is yours, but if the choice is
just to flag errors with a non-zero return, that should be made clear
in the doc and the example scripts should illustrate error-checking,
as in
err = SVAR_coint(<args>)
if err
...
else
...
endif
Allin