Filling a matrix on a loop
Posted: Sun Jul 26, 2020 8:53 am
Hello everyone,
I am new to the world of eviews and I am trying to make a program that will allow me to do a rolling regression using the residues of one equation as input for the another (main) equation. So I have a ferw questions that I hope will help me:
1. For each loop I need to store the residuals of the first equation in column "j" of a an empty matrix.
2. For each loop I need to store the coefficients of the second equation in row "i" of another matrix
3. My dependent variable has lags (+15) so I can't forecast, however, I would like to rescue the last fitted value and store it aswell on a vector
To give some context, what I am trying to do is to use the residues of an estimated equation with 5 years of data, as inputs to another equation, I need to do it for 20 years, always with 5 year windows and 1 day steps so it is a rolling regression
I hope you can help me,
best regards, JTO
I am new to the world of eviews and I am trying to make a program that will allow me to do a rolling regression using the residues of one equation as input for the another (main) equation. So I have a ferw questions that I hope will help me:
1. For each loop I need to store the residuals of the first equation in column "j" of a an empty matrix.
2. For each loop I need to store the coefficients of the second equation in row "i" of another matrix
3. My dependent variable has lags (+15) so I can't forecast, however, I would like to rescue the last fitted value and store it aswell on a vector
To give some context, what I am trying to do is to use the residues of an estimated equation with 5 years of data, as inputs to another equation, I need to do it for 20 years, always with 5 year windows and 1 day steps so it is a rolling regression
I hope you can help me,
best regards, JTO