## saving coefficients from different equations to the same matrix

For questions regarding programming in the EViews programming language.

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

vytama
Posts: 65
Joined: Wed Dec 19, 2012 11:05 am

### saving coefficients from different equations to the same matrix

Hello,
I have 1 loop and I am looping through 3 separate equations in it. Is it possible to save coefficients from those 3 equations into the same matrix? I can save betas from 1st equation but how do I add betas from other equations?

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

### Re: saving coefficients from different equations to the same matrix

vytama
Posts: 65
Joined: Wed Dec 19, 2012 11:05 am

### Re: saving coefficients from different equations to the same matrix

Thank you Gareth. It's helpful. What I am looking for is that my loop is forecasting out of sample and it expands by 1 period as the loop runs:

' Estimation sample

%t_insmpl_1 = "1970:1"
%t_insmpl_2 = "1990:12"

' Set out-of-sample estimation period

%t_outsmpl_1 = "1991:1"
%t_outsmpl_2 = "2021:04"

I am able to store constant and beta from first regression in the 1st and 2nd column of the matrix. can I add betas from 2nd regression to 3rd and 4th column of that matrix?

Thank you.

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

### Re: saving coefficients from different equations to the same matrix

Sure, if you want to.

vytama
Posts: 65
Joined: Wed Dec 19, 2012 11:05 am

### Re: saving coefficients from different equations to the same matrix

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

### Re: saving coefficients from different equations to the same matrix

That post I linked has an example.