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],
```

**Traceback:**

```
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>
{xout,fout,gout,cout}=optmum(&lik_fcn,prmtr_in);
```

## 1 Answer

0

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:

`PROB__T = INVPD(A'A)*A'EN;`

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:

`PROB__T = INVPD(A'A)*A'EN;`

into these two lines:

```
save A;
PROB__T = INVPD(A'A)*A'EN;
```

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;`

## Your Answer

**
0
**

## 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:

`PROB__T = INVPD(A'A)*A'EN;`

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:

`PROB__T = INVPD(A'A)*A'EN;`

into these two lines:

```
save A;
PROB__T = INVPD(A'A)*A'EN;
```

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;`