Singular matrix error

Dear professor @jpfeifer,

I am tagging You and asking for Your help.

1. Trying to run the estimation files “run.m” and “runa.m” in attachment several times, MATLAB crashes each time after an hour, prior to the hard crash I obtain thousands of errors “Matrix is singular”.

2. Trying to run the file in Octave, I obtain the following three errors:

>> runa
t0 = 1
warning: optimset: unrecognized option: ‘LargeScale’
warning: called from
optimset>setoptionfields at line 213 column 9
optimset at line 195 column 12
runa at line 151 column 10

warning: matrix singular to machine precision
warning: called from
runa at line 240 column 9

error: save: unable to save to tstarmat Permission denied
error: called from
runa at line 253 column 4

The original file “run.m” with data for France and my adjusted file “runa.m” with data for Slovenia are both attached (adjustments are commenting out few lines and replacing data file), as well as other required files:

run.m (6.6 KB)

llfn.m (8.2 KB)

llfnses.m (7.4 KB)

meancimpr.txt (6.7 KB) (I couldn’t upload .DAT file, so I saved is as .TXT instead)

runa.m (6.4 KB)

Slovenia_centered2.mat (4.4 KB)

What is the message of the crash? The singularity warning are from the matrix inversion of the forecast error matrix. If that continuously pops up, you either end up with strange parameter values or have a problem with stochastic singularity.

Many thanks, I am most grateful for Your reply! Again, I apologize for bothering You, but I am stuck.

The crash message is in the printscreen in attachment:

Finally, the professor who wrote this code confirmed me that he can run the file run.m successfully. How come only I have issues with strange parameter values or problem with stochastic singularity and he doesn’t? Thank You so much! I am running Dynare 6.2 and Octave 9.2.0 on Windows 11 Home.

That is strange. What are the details, i.e. which function crashed Matlab for what reason?

First, do You think I should contact the code author and ask him for advice? Perhaps, could You also try to run file run.m on Your machine?

Second, on MATLAB forum they said that the final cause for crash is irrelevant and that the key symptom is the warning “singular matrix” that comes from the command “inv(hessmatf)”.