Merge pull request #977 from JohannesPfeifer/calib_smoother_fix

Account for unset options/fields after yesterday's PR
time-shift
MichelJuillard 2015-07-21 14:48:45 +02:00
commit 1fd63b0dd2
4 changed files with 20 additions and 36 deletions

View File

@ -301,7 +301,7 @@ if options_.use_calibration_initialization %set calibration as starting values
[xparam1,estim_params_]=do_parameter_initialization(estim_params_,xparam1_calib,xparam1); %get explicitly initialized parameters that have precedence to calibrated values
end
if ~isempty(estim_params_)
if ~isempty(estim_params_) && ~strmatch(fieldnames(estim_params_),'full_calibration_detected')
if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0)
% Plot prior densities.
if ~options_.nograph && options_.plot_priors
@ -332,7 +332,7 @@ if ~isempty(estim_params_)
end
end
if isempty(estim_params_)% If estim_params_ is empty (e.g. when running the smoother on a calibrated model)
if isempty(estim_params_) || strmatch(fieldnames(estim_params_),'full_calibration_detected')% If estim_params_ is empty (e.g. when running the smoother on a calibrated model)
if ~options_.smoother
error('Estimation: the ''estimated_params'' block is mandatory (unless you are running a smoother)')
end

View File

@ -29,7 +29,11 @@ nc = 4;
nr = 3;
endo_names = M_.endo_names;
fname = M_.fname;
dname = M_.dname;
if ~isfield(M_,'dname')
dname = options_.dirname;
else
dname = M_.dname;
end
yf = oo_.forecast.Mean;
hpdinf = oo_.forecast.HPDinf;
hpdsup = oo_.forecast.HPDsup;

View File

@ -32,11 +32,19 @@ function xparam1=get_all_parameters(estim_params_,M_)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
nvx = estim_params_.nvx;
ncx = estim_params_.ncx;
nvn = estim_params_.nvn;
ncn = estim_params_.ncn;
np = estim_params_.np;
if ~isempty(estim_params_)
nvx = estim_params_.nvx;
ncx = estim_params_.ncx;
nvn = estim_params_.nvn;
ncn = estim_params_.ncn;
np = estim_params_.np;
else
nvx = 0;
ncx = 0;
nvn = 0;
ncn = 0;
np = 0;
end
Sigma_e = M_.Sigma_e;
Correlation_matrix = M_.Correlation_matrix;
H = M_.H;

View File

@ -96,34 +96,6 @@ var e_a; stderr 0.014;
var e_m; stderr 0.005;
end;
steady_state_model;
dA = exp(gam);
gst = 1/dA;
m = mst;
khst = ( (1-gst*bet*(1-del)) / (alp*gst^alp*bet) )^(1/(alp-1));
xist = ( ((khst*gst)^alp - (1-gst*(1-del))*khst)/mst )^(-1);
nust = psi*mst^2/( (1-alp)*(1-psi)*bet*gst^alp*khst^alp );
n = xist/(nust+xist);
P = xist + nust;
k = khst*n;
l = psi*mst*n/( (1-psi)*(1-n) );
c = mst/P;
d = l - mst + 1;
y = k^alp*n^(1-alp)*gst^alp;
R = mst/bet;
W = l/n;
ist = y-c;
q = 1 - d;
e = 1;
gp_obs = m/dA;
gy_obs = dA;
end;
steady;
check;
varobs gp_obs gy_obs;