structural VAR estimation
[A,B,param]=svar1(rvar,def_A,def_B,init)
* rvar = rvar tlist returned by VAR
* def_A = a string matrix, defining its non-zero elements as constants or functions of the vector or parameters
. 'A(i,j) = numerical value (e.g: 'A(1,1)=1')
. 'A(i,j) = param(k)' (e.g: 'A(4,2)=param(3)')
* def_B = a string matrix, defining its non-zero elements as constants or functions of the vector of parameters
* init = a (nparam x 1) real vector, defining the satrting values of the vector of parameters (optional)
* A = a (nvar x nvar) matrix, the estimated A matrix
* B = a (nvar x nvar) matrix, the estimated A matrix
* param = a (n x 1) vector, collecting the estimated parametrs of matrices A and B
* u = (correlated) residuals from the reduced form
* eps = (uncorrelated) structural residuals.
// data are taken from Breitung J, Bruggemann R, and L¨utkepohl H (2004), // Structural vector autoregressive modeling and impulse responses, // Applied Time Series Econometrics, Cambridge University Press global GROCERDIR ; load(GROCERDIR+'\data\breitung_et_al.dat') var_breit=VAR(4,'endo=ly;lm;ir') Def_A0=['A(2,1)=param(1)';'A(2,3)=param(2)';'A(3,1)=param(3)'] // A has the following form: // | 1 0 0 | // A = | param(1) 1 param(2) | // | param(3) 0 1 | Def_B0=['B(1,1)=param(4)';'B(2,2)=param(5)';'B(3,3)=param(6)'] // | param(4) 0 0 | // B = | 0 param(5) | // | 0 0 1 param(6) | [A,B,param]=svar1(var_breit,Def_A0,Def_B0) | ![]() | ![]() |