Hi, I am trying to take the inverse of a matrix with one value which is an NA. I want the inverse of this matrix to be an NA as well but it gives me an error. Anyone knows how to do this?
NA found in matrix in ""
Thanks
inverse matrix and NA value
Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: inverse matrix and NA value
There isn't an easy way to do this. But something like:
Where a is the matrix you're inverting.
Code: Select all
Matrix b = matrix a
b = na
setmaxerrs 2
b = @inverse(a)
-
superjocker
- Posts: 27
- Joined: Mon Mar 30, 2020 5:45 pm
Re: inverse matrix and NA value
Hi Gareth, yes it worked but the thing is I am running a loop when sometimes the inverse of the matrix is a number (because the matrix to inverse is a number matrix) and sometimes the inverse of the matrix gives me an error (because the matrix to inverse is a na matrix). I was trying to use your code with a @recode, but dindt work.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13600
- Joined: Tue Sep 16, 2008 5:38 pm
Re: inverse matrix and NA value
Should still work. Just increase allowed errors
-
superjocker
- Posts: 27
- Joined: Mon Mar 30, 2020 5:45 pm
Re: inverse matrix and NA value
Yes, it is working, thanks Gareth.
Who is online
Users browsing this forum: No registered users and 1 guest
