I need to create a matrix (n, m) where each pair n, m corresponds to the pair n, m of another matrix - the average of column m corresponding.
How can I do it?
thanks very much in advance,
Basic matrix programming
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Basic matrix programming
You'll have to explain that in more detail.
Follow us on Twitter @IHSEViews
-
- Posts: 24
- Joined: Tue Jun 13, 2017 12:04 pm
Re: Basic matrix programming
EViews Gareth wrote:You'll have to explain that in more detail.
I have 15 matrix called error!m where m goes from 2 to 16.
Each error!m matrix has 84 columns and 97 rows.
What I need is something like:
Create !M matrices with 97 rows and 84 columns called for example error_x_!M where m goes from 2 to 16.
For the matrix error_x_2, it is necessary that the observation (1,1) be equal to the observation (1, 1) of the matrix error1 minus the average of the first column of the matrix error1. For the observation (2, 1) that is equal to the observation (2, 1) of the matrix error1 minus the first column of the matrix of error1 (remains constant). and so on
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13315
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Basic matrix programming
Ah, the subtraction in your first post I took to be a hyphen.
Bit of simple matrix algebra:
Bit of simple matrix algebra:
Code: Select all
matrix error_x_2 = error_x_1 - @ones(97,1) * @transpose(@cmean(error_x_1))
Follow us on Twitter @IHSEViews
Who is online
Users browsing this forum: No registered users and 22 guests