Page 1 of 1

multiplying a series by an element of a matrix

Posted: Thu Feb 25, 2016 6:58 am
by DBel2012
Good morning,

I need to multiply a series by an element of a matrix, For instance :

I've got a series named varY, a matrix myMat, and I want to create a new series varX which is the product of element 1 of myMat and varY.

series varX = myMat(1) * varY

The only way I can do that is if I assign myMat(1) to a scalar; scalar temp = myMat(1) and then series varX = temp * varY.

I wonder why I cannot multiply a series by an element of a matrix.

Thanks!

Danny

Re: multiplying a series by an element of a matrix

Posted: Thu Feb 25, 2016 7:43 am
by EViews Gareth
Works fine for me:

Code: Select all

create u 10 matrix(3,3) mymat mymat = 5.5 series y = 2 series varx = mymat(1,1)*y

Re: multiplying a series by an element of a matrix

Posted: Thu Feb 25, 2016 8:20 am
by DBel2012
Hi,

You are right, it works perfectly.

My mistake. Since I had created a matrix with only one column, I thought I did not need to specify the column in the expression series varX = myMat(1) * varY

So, the right way is to write series varX = myMat(1,1) * varY

Thanks a lot for helping me.

Danny