Multiple Regression Near Singular Matrix

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt

James
Posts: 3
Joined: Fri Jul 10, 2009 3:52 am

Multiple Regression Near Singular Matrix

Postby James » Fri Jul 10, 2009 5:03 am

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13603
Joined: Tue Sep 16, 2008 5:38 pm

Re: Multiple Regression Near Singular Matrix

Postby EViews Gareth » Fri Jul 10, 2009 7:17 am

When you run the program, set the maximum error count to something larger than 1

James
Posts: 3
Joined: Fri Jul 10, 2009 3:52 am

Re: Multiple Regression Near Singular Matrix

Postby James » Fri Jul 10, 2009 7:29 am

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!

James
Posts: 3
Joined: Fri Jul 10, 2009 3:52 am

Re: Multiple Regression Near Singular Matrix

Postby James » Fri Jul 10, 2009 7:51 am

I just figured it out. Its in the box that pops up after you click 'run'

Thanks again.

Kim Alexander
Posts: 1
Joined: Thu Feb 11, 2010 11:24 am

Re: Multiple Regression Near Singular Matrix

Postby Kim Alexander » Thu Feb 11, 2010 11:42 am

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 2 guests