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!
Save Var results in a scalar, matrix,etc.
Moderators: EViews Gareth, EViews Moderator

 EViews Developer
 Posts: 364
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Save Var results in a scalar, matrix,etc.
Hello,
Take a look at the VAR object documentation. I believe the @ssr data member is what you're looking for.
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.
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.

 EViews Developer
 Posts: 364
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Save Var results in a scalar, matrix,etc.
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.
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?

 EViews Developer
 Posts: 364
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Save Var results in a scalar, matrix,etc.
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.
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!
Thank you very much for your answer!

 EViews Developer
 Posts: 364
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Save Var results in a scalar, matrix,etc.
Something like this...
The minimum SSRs are stored in vector min_ssr.
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.
Thank you very much!
Who is online
Users browsing this forum: No registered users and 4 guests