Ewise

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.

Ewise

Postby user_123 » Thu Jan 06, 2011 6:38 am

Dear users,

Im not sure about the last part [j-(j>i)] of this code:

ewise a(i,j)=%if(i==j,1.0,ap(i,j-(j>i)))

does this mean the following?:

if the elements of matrix (ap) are= a11 a12
a21 a22
a31 a32

and the elements of the matrix (a) are= b11 b12 b13
b21 b22 b23
b31 b32 b33

the b11=b22=b33=1
and b12= a11, b13=a12, b21=a21, b23=a22, b31=a31, b32=a32

Thank you in advance.
user_123
 
Posts: 4
Joined: Mon Jan 03, 2011 6:12 am

Re: Ewise

Postby TomDoan » Thu Jan 06, 2011 7:26 am

Suppose that you have a 3x3 matrix of parameters, but that the diagonal elements are fixed at 1 while the others are free. In effect, you have a 3 x 2 matrix of free parameters which needs to get expanded for use. That's what the EWISE does. From a 3x2 matrix, it creates a 3x3 matrix, inserting the 1's in the diagonal positions. It's probably easier to think about the reverse mapping; the matrix

1 a12 a13
a21 1 a23
a31 a32 1

is parameterized using

a12 a13
a21 a23
a31 a32
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: Ewise

Postby user_123 » Thu Jan 06, 2011 11:13 am

Thank you very much Tom!
user_123
 
Posts: 4
Joined: Mon Jan 03, 2011 6:12 am


Return to Help With Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest