inverse matrix and NA value

For questions regarding the import, export and manipulation of data in EViews, including graphing and basic statistics.

Moderators: EViews Gareth, EViews Steve, EViews Moderator, EViews Jason

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

inverse matrix and NA value

Postby superjocker » Wed Aug 19, 2020 11:15 am

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

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

Re: inverse matrix and NA value

Postby EViews Gareth » Wed Aug 19, 2020 11:45 am

There isn't an easy way to do this. But something like:

Code: Select all

Matrix b = matrix a b = na setmaxerrs 2 b = @inverse(a)
Where a is the matrix you're inverting.

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Re: inverse matrix and NA value

Postby superjocker » Wed Aug 19, 2020 12:11 pm

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

Postby EViews Gareth » Wed Aug 19, 2020 1:41 pm

Should still work. Just increase allowed errors

superjocker
Posts: 27
Joined: Mon Mar 30, 2020 5:45 pm

Re: inverse matrix and NA value

Postby superjocker » Thu Aug 20, 2020 11:15 am

Yes, it is working, thanks Gareth.


Return to “Data Manipulation”

Who is online

Users browsing this forum: No registered users and 1 guest