Home > matlab > gsa > set_shocks_param.m

set_shocks_param

PURPOSE ^

Copyright (C) 2012 Dynare Team

SYNOPSIS ^

function set_shocks_param(xparam1)

DESCRIPTION ^

 Copyright (C) 2012 Dynare Team

 This file is part of Dynare.

 Dynare is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 Dynare is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with Dynare.  If not, see <http://www.gnu.org/licenses/>.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function set_shocks_param(xparam1)
0002 
0003 % Copyright (C) 2012 Dynare Team
0004 %
0005 % This file is part of Dynare.
0006 %
0007 % Dynare is free software: you can redistribute it and/or modify
0008 % it under the terms of the GNU General Public License as published by
0009 % the Free Software Foundation, either version 3 of the License, or
0010 % (at your option) any later version.
0011 %
0012 % Dynare is distributed in the hope that it will be useful,
0013 % but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 % GNU General Public License for more details.
0016 %
0017 % You should have received a copy of the GNU General Public License
0018 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
0019 
0020 global estim_params_ M_
0021   
0022   nvx = estim_params_.nvx;
0023   ncx = estim_params_.ncx;
0024   np = estim_params_.np;
0025   Sigma_e = M_.Sigma_e;
0026   offset = 0;
0027   if nvx
0028     offset = offset + nvx;
0029     var_exo = estim_params_.var_exo;
0030     for i=1:nvx
0031       k = var_exo(i,1);
0032       Sigma_e(k,k) = xparam1(i)^2;
0033     end
0034   end
0035   
0036   if ncx
0037     offset = offset + estim_params_.nvn;
0038     corrx = estim_params_.corrx;
0039     for i=1:ncx
0040       k1 = corrx(i,1);
0041       k2 = corrx(i,2);
0042       Sigma_e(k1,k2) = xparam1(i+offset)*sqrt(Sigma_e_(k1,k1)*Sigma_e_(k2,k2));
0043       Sigma_e(k2,k1) = Sigma_e_(k1,k2);
0044     end
0045   end
0046   
0047   
0048   M_.Sigma_e = Sigma_e;

Generated on Mon 21-May-2012 02:42:43 by m2html © 2005