I'm trying to transfer the coefficients from a reduced form VAR to coefficient matrices, but the way I've tried seems to require going via a scalar variable.
In the simplest case, the following works:
scalar C1_11 = var01.c(1,1)
var01_C1.fill(b=r) C1_11, 0, 0, 0, 0, 0, 0, 0, 0
But the following doesn't (it returns 'Syntax error'):
var01_C1.fill(b=r) var01.c(1,1), 0, 0, 0, 0, 0, 0, 0, 0
Is there any way of doing it that doesn't require temporary scalar variables?
Thanks in advance. :)
Matrix Fill from VAR Coefficients (Quick Question)
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Matrix Fill from VAR Coefficients (Quick Question)
Code: Select all
var01_c1 = 0
var01_c1(1,1) = var01.c(1,1)
Re: Matrix Fill from VAR Coefficients (Quick Question)
Thanks for the very quick reply. :) That method would still require one line per element, but it looks like it can easily be put in a loop so that's fine. :)Code: Select all
var01_c1 = 0 var01_c1(1,1) = var01.c(1,1)
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13584
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Matrix Fill from VAR Coefficients (Quick Question)
It isn't particularly clear what you're trying to do. Why not just do:
Code: Select all
matrix var01_c1 = var01.coefmat
Re: Matrix Fill from VAR Coefficients (Quick Question)
I want it in the standard format (where C1 is the matrix of all lag 1 coefficients, C2 for lag 2, etc.), where:It isn't particularly clear what you're trying to do. Why not just do:Code: Select all
matrix var01_c1 = var01.coefmat
x_t = C1*x_t-1 + C2*x_t-2 + ...
is the reduced form VAR.
So with your first reply I can now just do:
Code: Select all
matrix(3,3) {%0}
for !i = 1 to 3
for !j = 1 to 3
{%0}(!i,!j) = var01.c(!i,({%1}+(!j-1)*4))
next
nextThanks again. :)
Who is online
Users browsing this forum: No registered users and 1 guest
