error : Matrix not positive definite

User Forumerror : Matrix not positive definite
Tri Marlina asked 2 years ago

error G0121 : Matrix not positive definite

this is program line 94 make error

SD_fnl = sqrt(diag(invpd(_opfhess)));

what make error?

1 Answers
aptech Staff answered 2 years ago

The function invpd returns the inverse of a positive definite matrix. If the input to invpd is not positive definite, then you will get the error:

error G0121 : Matrix not positive definite

You need to look at the matrix _opfhess before it is passed into the function invpd. You can do this with by using the debugger or a print statement.

If the contents of _opfhess are missing values or a scalar error code, they will print out like this:


If you see this, you will need to trace back in the program and see what caused this.