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
Multiple Regression Near Singular Matrix
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Multiple Regression Near Singular Matrix
When you run the program, set the maximum error count to something larger than 1
Re: Multiple Regression Near Singular Matrix
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!
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
I just figured it out. Its in the box that pops up after you click 'run'
Thanks again.
Thanks again.
-
Kim Alexander
- Posts: 1
- Joined: Thu Feb 11, 2010 11:24 am
Re: Multiple Regression Near Singular Matrix
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
matrix mtemp = eq1.@coefcov
if mtemp(1,1) <> NA then
...
else
...
endif
Who is online
Users browsing this forum: No registered users and 2 guests
