Elementwise multiplication
Moderators: EViews Gareth, EViews Jason, EViews Steve, EViews Moderator
Elementwise multiplication
I have a TxN matrix A that I want to multiply by a Tx1 vector b elementwise. That is, I want to multiply each of the N columns of length T by the vector b. This would work with the function @emult if the two matrices were of the same dimension (e.g., if A were Tx1 in my case). Is there a workaround for this problem?

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11923
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Elementwise multiplication
I think you'll have to do it manually in a for loop.
Follow us on Twitter @IHSEViews
Re: Elementwise multiplication
Hi there,
I am looking for the eviews command that would replicate the excel function mmult, this function is described as "Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.".
I have been using @inner but this seems to give me different results.
Any help would be much appreciated!
Thanks,
Abi
I am looking for the eviews command that would replicate the excel function mmult, this function is described as "Returns the matrix product of two arrays. The result is an array with the same number of rows as array1 and the same number of columns as array2.".
I have been using @inner but this seems to give me different results.
Any help would be much appreciated!
Thanks,
Abi

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11923
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Elementwise multiplication
Hi Gareth
This only works if the matrices are of the same size, in excel the data has to be the same number of columns as rows in the first.
Is there a way to do the matrix product of two matrices of differing sizes?
First matrix is 15x15 and the second is 1x15.
Thanks,
Abi
This only works if the matrices are of the same size, in excel the data has to be the same number of columns as rows in the first.
Is there a way to do the matrix product of two matrices of differing sizes?
First matrix is 15x15 and the second is 1x15.
Thanks,
Abi

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11923
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Elementwise multiplication
Follow us on Twitter @IHSEViews
Re: Elementwise multiplication
Oh wow! I was being genuinely moronic... Just needed to transpose one of the matrices. Apologies!
Who is online
Users browsing this forum: No registered users and 6 guests