Hi,
I am trying to replicate a matlab code in EViews but having trouble doing the following loop;
for jj=1:nstep;
impz(jj,:)=shock(jj,:)+zlag*betaz(1:length(betaz),:);
zlag=[impz(jj,:) zlag(1,1:(nlags-1)*nvars)];
end;
I've managed to convert lots of stuff but having trouble with this kinda looping and concatenation. Could anyone please help me with this? Thanks
C.
matlab to eviews
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: matlab to eviews
Can anyone respond please?
Re: matlab to eviews
Could you please at least tell us the dimensions of matrices/vectors you are dealing with?
Re: matlab to eviews
Thanks for your reply Trubador,
impz=15*7
shock=15*7
zlag=1*28
betaz=28*7
nlags=4
nvars=7
Hope it helps
C.
impz=15*7
shock=15*7
zlag=1*28
betaz=28*7
nlags=4
nvars=7
Hope it helps
C.
Re: matlab to eviews
This should be doing what you want:
Code: Select all
!nvars = @columns(shock)
!nstep = @rows(shock)
!nlags = 4
!extract = (!nlags-1)*!nvars
rowvector temp1
rowvector temp2
for !jj = 1 to !nstep
temp1 = @rowextract(shock,!jj)+zlag*betaz
temp2 = @subextract(zlag,1,1,1,!extract)
rowplace(impz,temp1,!jj)
matplace(zlag,temp1,1,1)
matplace(zlag,temp2,1,!nvars+1)
next
delete temp*Re: matlab to eviews
Trubador, that's awesome. Many thanks
Who is online
Users browsing this forum: No registered users and 2 guests
