Page 1 of 1

Save Var results in a scalar, matrix,etc.

Posted: Thu Apr 05, 2018 1:46 pm
by lpando08
Hi everyone!

I have run a VAR and I would like to know if there is exist a way to save the results, exactly the sum of squared residuals that appears in the window of VAR estimation outputs. I want to save that number in a scalar or matrix. Is there a command or a way to do this?

Thank you for your answers!

Re: Save Var results in a scalar, matrix,etc.

Posted: Thu Apr 05, 2018 1:59 pm
by EViews Matt
Hello,

Take a look at the VAR object documentation. I believe the @ssr data member is what you're looking for.

Re: Save Var results in a scalar, matrix,etc.

Posted: Thu Apr 05, 2018 2:04 pm
by lpando08
Hi, yes. I have tried to used it but I cant, do yo have any example where I can use this command running a VAR? I tried to used this commad after running the VAR but the programm says that there is no a equation especified.

Re: Save Var results in a scalar, matrix,etc.

Posted: Thu Apr 05, 2018 2:56 pm
by EViews Matt
You need to specify which VAR equation's SSR you want, e.g., @ssr(1), @ssr(2), etc.

Re: Save Var results in a scalar, matrix,etc.

Posted: Thu Apr 05, 2018 3:12 pm
by lpando08
Only a last question please, if I have 2 vars: var 1 and var2, the first with 3 equations and the second with 4. Is there any way to save the total ssr generated, I mean in this case to save the seven ssr that would be generated? and then to find the minimun of them?

Re: Save Var results in a scalar, matrix,etc.

Posted: Thu Apr 05, 2018 3:30 pm
by EViews Matt
Sure, a few loops can easily go through any number of VARs you wish with any number of equations per VAR:

Code: Select all

!k = 1 for %v var1 var2 for !i = 1 to {%v}.@neqn vector(!k) ssr(!k) = {%v}.@ssr(!i) !k = !k + 1 next next scalar min_ssr = @mins(ssr, 1)

Re: Save Var results in a scalar, matrix,etc.

Posted: Thu Apr 05, 2018 4:38 pm
by lpando08
Hello, thank you very much for your answer but I think I made a mistake and this was not what I was looking for :(. Actually, I have this a var_{%grp} that goes from var_1 to var_n, each of them have différent number of équations. What I want to do is for each équation of each var ( from var_1 to var_n) save the ssr’s and then for each var find the minimun ssr. I mean have the minimun ssr for each var.

Thank you very much for your answer!

Re: Save Var results in a scalar, matrix,etc.

Posted: Fri Apr 06, 2018 8:48 am
by EViews Matt
Something like this...

Code: Select all

!m = 1 for !i = 1 to <fill in n> !k = 1 for !j = 1 to var_!i.@neqn vector(!k) ssr(!k) = var_!i.@ssr(!j) !k = !k + 1 next !tmp = @mins(ssr, 1) vector(!m) min_ssr(!m) = !tmp !m = !m + 1 next
The minimum SSRs are stored in vector min_ssr.

Re: Save Var results in a scalar, matrix,etc.

Posted: Sat Apr 07, 2018 9:31 pm
by lpando08
Thank you very much!