Matrix singular


Please help me, what is causing this error?

G0048: Matrix singular [MS_EGARCH_PFT (2).txt, line 202]

Currently active call:

File MS_EGARCH_PFT (2).txt, line 202, in lik_fcn
PROB__T = INV(A'A)*A'EN; @PR[S_t=0]|PR[S_t=1],


File optutil.src, line 445, in _optmum
vof1 = fnct(x0+d);
File optmum.src, line 264, in optmum
{ x,f0,g,retcode,Lopfhess,Lopitdta } = _optmum(fnct,x0,
File MS_EGARCH_PFT (2).txt, line 70, in <main>

1 Answer


Based upon your error messages, on line 202 of the file MS_EGARCH_PFT (2).txt, when GAUSS tries to calculate the of A'A this matrix is singular.

I am guessing that this line used to read:


but, you changed INVPD to INV, because you were getting an error message from this line that A'A was not positive definite.

You need to check the contents of the matrix A. Since the matrix is singular, we know that not all of the rows and columns are linearly independent. The first thing you should do is find out what A is at the time that this error is occurring.

A simple way to do this is to have GAUSS save the matrix A to your hard drive before this call and then load the matrix after you run the program again.

I would change this one line:


into these two lines:

save A;

Then run your program again. After it finishes (with an error), then enter:

load A;

and you can examine the contents of A at the time of the error. If A is small enough, you could just print the contents of A to the screen like this:

print A;

You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy