2006-03-05 22:01:27 +01:00
|
|
|
function set_parameters(xparam1)
|
2008-01-10 16:47:41 +01:00
|
|
|
|
|
|
|
% function set_parameters(xparam1)
|
|
|
|
% Sets parameters value (except measurement errors)
|
2008-02-16 18:02:39 +01:00
|
|
|
% This is called for computations such as IRF and forecast
|
|
|
|
% when measurement errors aren't taken into account
|
2008-01-10 16:47:41 +01:00
|
|
|
%
|
|
|
|
% INPUTS
|
|
|
|
% xparam1: vector of parameters to be estimated (initial values)
|
|
|
|
%
|
|
|
|
% OUTPUTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% SPECIAL REQUIREMENTS
|
|
|
|
% none
|
|
|
|
%
|
|
|
|
% part of DYNARE, copyright Dynare Team (2003-2008)
|
|
|
|
% Gnu Public License.
|
|
|
|
|
2006-03-05 22:01:27 +01:00
|
|
|
global estim_params_ M_
|
|
|
|
|
2008-02-16 18:02:39 +01:00
|
|
|
global estim_params_ M_
|
|
|
|
|
2006-03-05 22:01:27 +01:00
|
|
|
nvx = estim_params_.nvx;
|
|
|
|
ncx = estim_params_.ncx;
|
2008-02-16 18:02:39 +01:00
|
|
|
nvn = estim_params_.nvn;
|
|
|
|
ncn = estim_params_.ncn;
|
2006-03-05 22:01:27 +01:00
|
|
|
np = estim_params_.np;
|
|
|
|
Sigma_e = M_.Sigma_e;
|
2006-11-04 17:12:47 +01:00
|
|
|
offset = 0;
|
2008-02-16 18:02:39 +01:00
|
|
|
|
|
|
|
% stderrs of the exogenous shocks
|
2006-03-05 22:01:27 +01:00
|
|
|
if nvx
|
|
|
|
var_exo = estim_params_.var_exo;
|
|
|
|
for i=1:nvx
|
|
|
|
k = var_exo(i,1);
|
|
|
|
Sigma_e(k,k) = xparam1(i)^2;
|
|
|
|
end
|
|
|
|
end
|
2008-02-16 18:02:39 +01:00
|
|
|
% and update offset
|
|
|
|
offset = offset + nvx + nvn;
|
|
|
|
|
|
|
|
% correlations amonx shocks (ncx)
|
2006-03-05 22:01:27 +01:00
|
|
|
if ncx
|
|
|
|
corrx = estim_params_.corrx;
|
|
|
|
for i=1:ncx
|
|
|
|
k1 = corrx(i,1);
|
|
|
|
k2 = corrx(i,2);
|
2007-06-20 16:52:18 +02:00
|
|
|
Sigma_e(k1,k2) = xparam1(i+offset)*sqrt(Sigma_e(k1,k1)*Sigma_e(k2,k2));
|
|
|
|
Sigma_e(k2,k1) = Sigma_e(k1,k2);
|
2006-03-05 22:01:27 +01:00
|
|
|
end
|
|
|
|
end
|
2008-02-16 18:02:39 +01:00
|
|
|
% and update offset
|
|
|
|
offset = offset + ncx + ncn;
|
|
|
|
|
|
|
|
% structural parameters
|
2006-03-05 22:01:27 +01:00
|
|
|
if np
|
2006-03-10 14:04:50 +01:00
|
|
|
M_.params(estim_params_.param_vals(:,1)) = xparam1(offset+1:end);
|
2006-03-05 22:01:27 +01:00
|
|
|
end
|
2008-02-16 18:02:39 +01:00
|
|
|
|
2006-03-10 14:04:50 +01:00
|
|
|
M_.Sigma_e = Sigma_e;
|