Basic matrix programming

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

karakilamaravilla
Posts: 24
Joined: Tue Jun 13, 2017 12:04 pm

Basic matrix programming

Postby karakilamaravilla » Thu Jun 15, 2017 1:07 pm

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,

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13315
Joined: Tue Sep 16, 2008 5:38 pm

Re: Basic matrix programming

Postby EViews Gareth » Thu Jun 15, 2017 1:11 pm

You'll have to explain that in more detail.
Follow us on Twitter @IHSEViews

karakilamaravilla
Posts: 24
Joined: Tue Jun 13, 2017 12:04 pm

Re: Basic matrix programming

Postby karakilamaravilla » Thu Jun 15, 2017 1:25 pm

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

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13315
Joined: Tue Sep 16, 2008 5:38 pm

Re: Basic matrix programming

Postby EViews Gareth » Thu Jun 15, 2017 1:45 pm

Ah, the subtraction in your first post I took to be a hyphen.

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


Return to “Programming”

Who is online

Users browsing this forum: No registered users and 22 guests