Page 1 of 1

Multiple Regression Near Singular Matrix

Posted: Fri Jul 10, 2009 5:03 am
by James
Hello,

I am trying to write a program to scan through a set of data, performing a regression between various points, dependings on another input variable that I can control.

This proram works really well some of the time. Other times it gives me a near singular matrix error. I can only assume this is because occationally it meets a set of data that acts like a near singular matrix, rather then it being an error in the program?

I cannot see how to solve this. There is obviously no problem with the program, as it will run perfectly sometimes. Other times it will NSM error, just because I have changed the data it is operating on.

Is there any way I can get it to "skip" the data where a NSM error is found, and continue on regardless? The amount of results I am generating means its not a problem if I loose 3 or 4.

Thanks

Re: Multiple Regression Near Singular Matrix

Posted: Fri Jul 10, 2009 7:17 am
by EViews Gareth
When you run the program, set the maximum error count to something larger than 1

Re: Multiple Regression Near Singular Matrix

Posted: Fri Jul 10, 2009 7:29 am
by James
Hi,

Thanks for the reply. I can see the @errorcount function, but how do I initialise the equations objects error count in the first place?

E.g. EQ1.ls variable1 c variable2 variable 3

What do I add to the above to do that?

Thanks very much, very appreciated!

Re: Multiple Regression Near Singular Matrix

Posted: Fri Jul 10, 2009 7:51 am
by James
I just figured it out. Its in the box that pops up after you click 'run'

Thanks again.

Re: Multiple Regression Near Singular Matrix

Posted: Thu Feb 11, 2010 11:42 am
by Kim Alexander
You can try to check whether the matrix is singular or not the following way:
matrix mtemp = eq1.@coefcov
if mtemp(1,1) <> NA then
...
else
...
endif