Dear all,
I have successfully run a Panel SVAR code in EViews, but have been unable to interpret the portion of the code relating to the identification of the structural shock. I initially thought it was Shortrun recursive (Cholesky), but this is not supported by the impulse response functions (i.e. there is contemporaneous impact on the variables ordered before the shock variable (policy variable). Would be grateful if you could assist me interpret the codes below. Also, how should the codes be rewritten to achieve a shortrun recursive (cholesky) identification?
Thanks very much.
' The structural shocks are recovered and saved in a matrix called srmat
matrix coefmat = varest{!R}.@coefmat
matrix(!m,!m) varlagsums = @identity(!m)
for !row=1 to !m
for !col=1 to !m
for !lag=1 to !lagopt
varlagsums(!row,!col) = varlagsums(!row,!col)  coefmat(!lag + (!row1)*!lagopt, !col)
next
next
next
varlagsums = @transpose(varlagsums)
matrix varlagsums_inv = @inverse(varlagsums)
' nondof adjusted residual covariance matrix
sym residcov = (varestbar.@regobs  varestbar.@ncoefs/!m)/(varestbar.@regobs) * varest{!R}.@residcov
sym qresidcov = varlagsums_inv * residcov * @transpose(varlagsums_inv)
matrix A1 = @cholesky(qresidcov)
matrix A0 = varlagsums*A1
matrix srmat{!R} = @transpose(@inverse(A0) * @transpose(resmat{!R}))
Structural Shock Identification in VARs
Moderators: EViews Gareth, EViews Moderator

 EViews Developer
 Posts: 402
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Structural Shock Identification in VARs
Hello,
I believe that code is calculating the longrun shocks. To generate shortrun shocks, in the last line replace "A0" with "A1", effectively ignoring the A0 calculation.
I believe that code is calculating the longrun shocks. To generate shortrun shocks, in the last line replace "A0" with "A1", effectively ignoring the A0 calculation.
Re: Structural Shock Identification in VARs
Thanks Matt. Should the lines below remain unchanged?
matrix A1 = @cholesky(qresidcov)
matrix A0 = varlagsums*A1
matrix A1 = @cholesky(qresidcov)
matrix A0 = varlagsums*A1

 EViews Developer
 Posts: 402
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Structural Shock Identification in VARs
Correct. Although, you could remove the A0 line since it is not used in calculating the shortrun shocks.
Edit: Actually, now that I look at it again, there are calculations that cancel out. Discarding the unnecessary pieces, the shortrun equivalent for that entire block of code might be just:
Edit: Actually, now that I look at it again, there are calculations that cancel out. Discarding the unnecessary pieces, the shortrun equivalent for that entire block of code might be just:
Code: Select all
sym residcov = (varestbar.@regobs  varestbar.@ncoefs/!m)/(varestbar.@regobs) * varest{!R}.@residcov
matrix srmat{!R} = resmat{!R} * @transpose(@inverse(@cholesky(residcov)))
Who is online
Users browsing this forum: No registered users and 2 guests