Page 1 of 1

Matrix inverse problem

Posted: Fri Apr 08, 2016 6:50 am
by trubador
I couldn't figure out why there is such a big difference in the results:

Code: Select all

importmat(name=xmat) C:\Users\...\Desktop\xmat.xlsx matrix ymat = xmat*@inverse(@inner(xmat))*@transpose(xmat) xopen(m) xput xmat xrun "zmat=xmat*inv(xmat'*xmat)*xmat';" xget zmat matrix difmat = ymat-zmat scalar difsum = @sum(difmat) show difsum

Re: Matrix inverse problem

Posted: Fri Apr 08, 2016 8:34 am
by EViews Gareth
Not sure, but I just did it in R and R matches the EViews results (I think).

Re: Matrix inverse problem

Posted: Fri Apr 08, 2016 10:28 am
by EViews Gareth
Further, since you're taking a projection matrix, the following should result in a matrix of approximately zero (I think):

Code: Select all

matrix test1 = xmat.@t*(@identity(467)-ymat) matrix test2 = xmat.@t*(@identity(467)-zmat)