Page 1 of 1

Filling vector with appropriate matrix elements

Posted: Mon Aug 11, 2014 1:17 am
by przem
Hi,
I have one problem - I want to set vector which is composed of some elements of variance-covariance matrix of residuals. I place example below.
Przechwytywanie.JPG
Przechwytywanie.JPG (26.88 KiB) Viewed 3927 times
I have matrix like above and I need vector with 4 rows filled with elements from the matrix:
-c1,r2/c3,r2
1
-c3,r1/c2,r2
c4,r3/c4,r4

where c and r are columns and rows of matrix which I placed above.

Could anyone give me some advice or the syntax? I really need it.

Thank you in advance.

Re: Filling vector with appropriate matrix elements

Posted: Mon Aug 11, 2014 7:58 am
by EViews Gareth
I cannot follow your notation at all, but in general you can use (i,j) notation:

Code: Select all

myvector(2) = mymatrix(3,4)
sets the second element of the vector myvector equal to the 3rd row, 4th column element of the matrix mymatrix.

Re: Filling vector with appropriate matrix elements

Posted: Tue Aug 12, 2014 1:12 am
by przem
It works!
Thank you :)