...
 
Commits (9)
......@@ -194,7 +194,10 @@ while fpar<B
end
if MAX_nirfs_dsgevar
IRUN = IRUN+1;
[fval,info,~,~,~,~,~,PHI,SIGMAu,iXX] = dsge_var_likelihood(deep',dataset_,dataset_info,options_,M_,estim_params_,bayestopt_,bounds,oo_);
[fval, info,~, args] = dsge_var_likelihood(deep', oo_.dsgevar.sample, options_, M_, estim_params_, bayestopt_, bounds, oo_);
PHI = args.PHI_tilde;
SIGMAu = args.SIGMA_u_tilde;
iXX = args.iXX;
dsge_prior_weight = M_.params(strmatch('dsge_prior_weight', M_.param_names));
DSGE_PRIOR_WEIGHT = floor(dataset_.nobs*(1+dsge_prior_weight));
SIGMA_inv_upper_chol = chol(inv(SIGMAu*dataset_.nobs*(dsge_prior_weight+1)));
......
......@@ -20,7 +20,7 @@ function oo_=display_estimation_results_table(xparam1,stdh,M_,options_,estim_par
% SPECIAL REQUIREMENTS
% None.
% Copyright (C) 2014-2018 Dynare Team
% Copyright © 2014-2019 Dynare Team
%
% This file is part of Dynare.
%
......@@ -42,7 +42,6 @@ nvn = estim_params_.nvn; % Variance of the measurement innovations (number of p
ncx = estim_params_.ncx; % Covariance of the structural innovations (number of parameters).
ncn = estim_params_.ncn; % Covariance of the measurement innovations (number of parameters).
np = estim_params_.np ; % Number of deep parameters.
nx = nvx+nvn+ncx+ncn+np; % Total number of parameters to be estimated.
skipline()
disp(['RESULTS FROM ' upper(table_title) ' ESTIMATION'])
......@@ -204,7 +203,7 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
ip = 1;
for i=1:nvx
k = estim_params_.var_exo(i,1);
fprintf(fidTeX,[ '$%s$ & %4s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n'],...
fprintf(fidTeX, '$%s$ & %4s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n', ...
M_.exo_names_tex{k},...
pnames{bayestopt_.pshape(ip)+1},...
bayestopt_.p1(ip),...
......@@ -221,8 +220,8 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
TeXBegin_Bayesian(fidTeX,3,'standard deviation of measurement errors')
ip = nvx+1;
for i=1:nvn
idx = strmatch(options_.varobs{estim_params_.nvn_observable_correspondence(i,1)}, M_.endo_names);
fprintf(fidTeX,'$%s$ & %4s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n',...
idx = strcmp(options_.varobs{estim_params_.nvn_observable_correspondence(i,1)}, M_.endo_names);
fprintf(fidTeX, '$%s$ & %4s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n',...
M_.endo_names_tex{idx}, ...
pnames{bayestopt_.pshape(ip)+1}, ...
bayestopt_.p1(ip), ...
......@@ -241,7 +240,7 @@ if any(bayestopt_.pshape > 0) && options_.TeX %% Bayesian estimation (posterior
for i=1:ncx
k1 = estim_params_.corrx(i,1);
k2 = estim_params_.corrx(i,2);
fprintf(fidTeX,[ '$%s$ & %s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n'],...
fprintf(fidTeX, '$%s$ & %s & %7.3f & %6.4f & %8.4f & %7.4f \\\\ \n', ...
[M_.exo_names_tex{k1} ',' M_.exo_names_tex{k2}], ...
pnames{bayestopt_.pshape(ip)+1}, ...
bayestopt_.p1(ip), ...
......@@ -294,7 +293,7 @@ elseif all(bayestopt_.pshape == 0) && options_.TeX %% MLE and GMM Latex output
ip = 1;
for i=1:nvx
k = estim_params_.var_exo(i,1);
fprintf(fidTeX,[ '$%s$ & %8.4f & %7.4f & %7.4f\\\\ \n'], ...
fprintf(fidTeX, '$%s$ & %8.4f & %7.4f & %7.4f\\\\ \n', ...
M_.exo_names_tex{k}, ...
xparam1(ip), ...
stdh(ip), ...
......@@ -309,7 +308,7 @@ elseif all(bayestopt_.pshape == 0) && options_.TeX %% MLE and GMM Latex output
TeXBegin_ML(fidTeX, 3, 'standard deviation of measurement errors', table_title, LaTeXtitle)
ip = nvx+1;
for i=1:nvn
idx = strmatch(options_.varobs{estim_params_.nvn_observable_correspondence(i,1)}, M_.endo_names);
idx = strcmp(options_.varobs{estim_params_.nvn_observable_correspondence(i,1)}, M_.endo_names);
fprintf(fidTeX, '$%s$ & %8.4f & %7.4f & %7.4f \\\\ \n', ...
M_.endo_names_tex{idx}, ...
xparam1(ip), ...
......@@ -327,7 +326,7 @@ elseif all(bayestopt_.pshape == 0) && options_.TeX %% MLE and GMM Latex output
for i=1:ncx
k1 = estim_params_.corrx(i,1);
k2 = estim_params_.corrx(i,2);
fprintf(fidTeX,[ '$%s$ & %8.4f & %7.4f & %7.4f \\\\ \n'], ...
fprintf(fidTeX, '$%s$ & %8.4f & %7.4f & %7.4f \\\\ \n', ...
[M_.exo_names_tex{k1} ',' M_.exo_names_tex{k2}], ...
xparam1(ip), ...
stdh(ip), ...
......
This diff is collapsed.
function [fval ,info, exitflag, grad, hess, SteadyState, trend_coeff, PHI_tilde, SIGMA_u_tilde, iXX,prior] = ...
dsge_var_likelihood(xparam1, ...
Sample, ...
DynareOptions, DynareModel, ...
EstimatedParameters, ...
BayesInfo, BoundsInfo, ...
DynareResults)
function [fval ,info, exitflag, ArgOut] = dsge_var_likelihood(xparam1, Sample, DynareOptions, DynareModel, EstimatedParameters, BayesInfo, BoundsInfo, DynareResults)
% Evaluates the posterior kernel of the bvar-dsge model.
%
......@@ -15,36 +9,27 @@ function [fval ,info, exitflag, grad, hess, SteadyState, trend_coeff, PHI_tilde,
% OUTPUTS
% - fval [double] Value of the posterior kernel at xparam1.
% - info [integer] Vector of informations about the penalty.
% - exitflag [integer] Zero if the function returns a penalty, one otherwise.
% - grad [double] place holder for gradient of the likelihood
% currently not supported by dsge_var
% - hess [double] place holder for hessian matrix of the likelihood
% currently not supported by dsge_var
% - SteadyState [double] Steady state vector possibly recomputed
% by call to dynare_resolve()
% - trend_coeff [double] place holder for trend coefficients,
% currently not supported by dsge_var
% - PHI_tilde [double] Stacked BVAR-DSGE autoregressive matrices (at the mode associated to xparam1);
% formula (28), DS (2004)
% - SIGMA_u_tilde [double] Covariance matrix of the BVAR-DSGE (at the mode associated to xparam1),
% formula (29), DS (2004)
% - iXX [double] inv(lambda*T*Gamma_XX^*+ X'*X)
% - prior [double] a matlab structure describing the dsge-var prior
% - SIGMA_u_star: prior covariance matrix, formula (23), DS (2004)
% - PHI_star: prior autoregressive matrices, formula (22), DS (2004)
% - ArtificialSampleSize: number of artificial observations from the prior (T^* in DS (2004))
% - DF = prior.ArtificialSampleSize - NumberOfParameters - NumberOfObservedVariables;
% - iGXX_star: theoretical covariance of regressors ({\Gamma_{XX}^*}^{-1} in DS (2004))
% - exitflag [integer] Zero if the function returns a penalty, one otherwise.
% - ArgOut [struct] Additional output arguments:
% + SteadyState [double] Steady state vector possibly recomputed by call to dynare_resolve()
% + PHI_tilde [double] Stacked BVAR-DSGE autoregressive matrices (at the mode associated to xparam1);
% formula (28), DS (2004)
% + SIGMA_u_tilde [double] Covariance matrix of the BVAR-DSGE (at the mode associated to xparam1),
% formula (29), DS (2004)
% + iXX [double] inv(lambda*T*Gamma_XX^*+ X'*X)
% + prior [struct] Description of the dsge-var prior
% - SIGMA_u_star: prior covariance matrix, formula (23), DS (2004)
% - PHI_star: prior autoregressive matrices, formula (22), DS (2004)
% - ArtificialSampleSize: number of artificial observations from the prior (T^* in DS (2004))
% - DF = prior.ArtificialSampleSize - NumberOfParameters - NumberOfObservedVariables;
% - iGXX_star: theoretical covariance of regressors ({\Gamma_{XX}^*}^{-1} in DS (2004))
%
% ALGORITHMS
% Follows the computations outlined in Del Negro/Schorfheide (2004):
% Priors from general equilibrium models for VARs, International Economic
% Review, 45(2), pp. 643-673
%
% SPECIAL REQUIREMENTS
% None.
% Copyright (C) 2006-2019 Dynare Team
% Copyright © 2006-2019 Dynare Team
%
% This file is part of Dynare.
%
......@@ -61,17 +46,10 @@ function [fval ,info, exitflag, grad, hess, SteadyState, trend_coeff, PHI_tilde,
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
% Initialize some of the output arguments.
fval = Inf;
exitflag = 1;
grad=[];
hess=[];
info = zeros(4,1);
PHI_tilde = [];
SIGMA_u_tilde = [];
iXX = [];
prior = [];
trend_coeff=[];
ArgOut = [];
% Ensure that xparam1 is a column vector.
xparam1 = xparam1(:);
......@@ -310,18 +288,18 @@ if isinf(fval)~=0
return
end
if (nargout >= 10)
if nargout>3
ArgOut.SteadyState = SteadyState;
ArgOut.PHI_tilde = PHI_tilde;
ArgOut.SIGMA_u_tilde = SIGMA_u_tilde;
if isinf(dsge_prior_weight)
iXX = inv(GXX);
ArgOut.iXX = inv(GXX);
else
iXX = inv(dsge_prior_weight*NumberOfObservations*GXX+mXX);
ArgOut.iXX = inv(dsge_prior_weight*NumberOfObservations*GXX+mXX);
end
end
if (nargout==11)
prior.SIGMA_u_star = SIGMA_u_star;
prior.PHI_star = PHI_star;
prior.ArtificialSampleSize = fix(dsge_prior_weight*NumberOfObservations);
prior.DF = prior.ArtificialSampleSize - NumberOfParameters - NumberOfObservedVariables;
prior.iGXX_star = inv(GXX);
ArgOut.prior.SIGMA_u_star = SIGMA_u_star;
ArgOut.prior.PHI_star = PHI_star;
ArgOut.prior.ArtificialSampleSize = fix(dsge_prior_weight*NumberOfObservations);
ArgOut.prior.DF = ArgOut.prior.ArtificialSampleSize - NumberOfParameters - NumberOfObservedVariables;
ArgOut.prior.iGXX_star = inv(GXX);
end
\ No newline at end of file
......@@ -134,17 +134,37 @@ if ~isempty(estim_params_)
M_ = set_all_parameters(xparam1,estim_params_,M_);
end
if ~options_.online_filter && options_.particle.status
options_ = set_nonlinear_filter_algorithm(options_);
end
if ~options_.dsge_var
oo_.dsgevar.sample = [];
end
function [f, info, exitflag, args] = nonlineardsge(xparam)
[f, info, exitflag, args] = non_linear_dsge_likelihood(xparam, dataset_, options_, M_, estim_params_, bayestopt_, bounds, oo_);
end
function [f, info, exitflag, args] = lineardsge(xparam)
[f, info, exitflag, args] = dsge_likelihood(xparam, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
end
function [f, info, exitflag, args] = dsgevar(xparam)
[f, info, exitflag, args] = dsge_var_likelihood(xparam, oo_.dsgevar.sample, options_, M_, estim_params_, bayestopt_, bounds, oo_);
end
if ~options_.online_filter
% Set objective function
if ~options_.dsge_var
if options_.particle.status
objfun = @(xparam) non_linear_dsge_likelihood(xparam, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
options_ = set_nonlinear_filter_algorithm(options_);
objfun = @(x) nonlineardsge(x);
else
objfun = @(xparam) dsge_likelihood(xparam, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
objfun = @(x) lineardsge(x);
end
else
objfun = @(xparam) dsge_var_likelihood(xparam, oo_.dsgevar.sample, options_, M_, estim_params_, bayestopt_, bounds, oo_);
objfun = @(x) dsgevar(x);
end
% perform initial estimation checks;
try
......@@ -369,8 +389,11 @@ if any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
skipline()
end
if options_.dsge_var
[~, ~, ~, ~, ~, ~, ~, oo_.dsgevar.posterior_mode.PHI_tilde, oo_.dsgevar.posterior_mode.SIGMA_u_tilde, oo_.dsgevar.posterior_mode.iXX, oo_.dsgevar.posterior_mode.prior] =...
feval(objfun,xparam1);
[~, ~, ~, args] = feval(objfun,xparam1);
oo_.dsgevar.posterior_mode.PHI_tilde = args.PHI_tilde;
oo_.dsgevar.posterior_mode.SIGMA_u_tilde = args.SIGMA_u_tilde;
oo_.dsgevar.posterior_mode.iXX = args.iXX;
oo_.dsgevar.posterior_mode.prior = args.prior;
end
elseif ~any(bayestopt_.pshape > 0) && ~options_.mh_posterior_mode_estimation
oo_ = display_estimation_results_table(xparam1, stdh, M_, options_, estim_params_, bayestopt_, oo_, pnames, 'Maximum Likelihood', 'mle');
......@@ -803,3 +826,4 @@ end
if first_obs_nan_indicator
options_.first_obs=NaN;
end
end
\ No newline at end of file
This diff is collapsed.
......@@ -89,7 +89,7 @@ end
% stailstr=[' P' num2str(i) stailstr];
%end
[f0, cost_flag, arg1] = penalty_objective_function(x0, fcn, penalty);
[f0, cost_flag, args] = penalty_objective_function(x0, fcn, penalty);
if ~cost_flag
disp_verbose('Bad initial parameter.',Verbose)
......@@ -101,8 +101,8 @@ if NumGrad
elseif ischar(grad)
[g,badg] = grad(x0);
else
g=arg1;
badg=0;
g = args.DLIK;
badg = 0;
end
retcode3=101;
x=x0;
......@@ -140,7 +140,8 @@ while ~done
elseif ischar(grad)
[g1, badg1] = grad(x1);
else
[~, cost_flag, g1] = penalty_objective_function(x1, fcn, penalty);
[~, cost_flag, args] = penalty_objective_function(x1, fcn, penalty);
g1 = args.DLIK;
badg1 = ~cost_flag;
end
wall1=badg1;
......@@ -167,7 +168,8 @@ while ~done
elseif ischar(grad)
[g2, badg2] = grad(x2);
else
[~, cost_flag, g2] = penalty_objective_function(x1, fcn, penalty);
[~, cost_flag, args] = penalty_objective_function(x1, fcn, penalty);
g2 = args.DLIK;
badg2 = ~cost_flag;
end
wall2=badg2;
......@@ -199,7 +201,8 @@ while ~done
elseif ischar(grad)
[g3, badg3] = grad(x3);
else
[~, cost_flag, g3] = penalty_objective_function(x1, fcn, penalty);
[~, cost_flag, args] = penalty_objective_function(x1, fcn, penalty);
g3 = args.DLIK;
badg3 = ~cost_flag;
end
wall3=badg3;
......@@ -259,7 +262,8 @@ while ~done
elseif ischar(grad)
[gh, badgh] = grad(xh);
else
[~, cost_flag, gh] = penalty_objective_function(x1, fcn, penalty);
[~, cost_flag, args] = penalty_objective_function(x1, fcn, penalty);
gh = args.DLIK;
badgh = ~cost_flag;
end
end
......
......@@ -284,7 +284,7 @@ switch minimizer_algorithm
if options_.silent_optimizer
simplexOptions.verbosity = 0;
end
[opt_par_values, fval, exitflag] = simplex_optimization_routine(objective_function, start_par_value, simplexOptions, parameter_names);
[opt_par_values, fval, exitflag] = simplex_optimization_routine(objective_function, start_par_value, simplexOptions);
case 9
% Set defaults
H0 = (bounds(:,2)-bounds(:,1))*0.2;
......
......@@ -48,7 +48,8 @@ function [hessian_mat, gg, htol1, ihh, hh_mat0, hh1, hess_info] = mr_hessian(x,
n=size(x,1);
[f0, ~, ff0] = penalty_objective_function(x, func, penalty);
[f0, ~, args] = penalty_objective_function(x, func, penalty);
ff0 = args.DLIK;
h2 = bounds(:,2)-bounds(:,1);
hmax = bounds(:,2)-x;
hmax = min(hmax,x-bounds(:,1));
......@@ -83,7 +84,8 @@ while i<n
hcheck = 0;
xh1(i) = x(i)+hess_info.h1(i);
try
[fx, ~, ffx] = penalty_objective_function(xh1, func, penalty);
[fx, ~, args] = penalty_objective_function(xh1, func, penalty);
ffx = args.DLIK;
catch
fx = 1.e8;
end
......@@ -104,7 +106,8 @@ while i<n
hess_info.h1(i) = max(hess_info.h1(i), 1.e-10);
xh1(i) = x(i)+hess_info.h1(i);
try
[fx, ~, ffx] = penalty_objective_function(xh1, func, penalty);
[fx, ~, args] = penalty_objective_function(xh1, func, penalty);
ffx = args.DLIK;
catch
fx = 1.e8;
end
......@@ -114,7 +117,8 @@ while i<n
hess_info.h1(i) = max(hess_info.h1(i), 1e-10);
xh1(i) = x(i)+hess_info.h1(i);
try
[fx, ~, ffx] = penalty_objective_function(xh1, func, penalty);
[fx, ~, args] = penalty_objective_function(xh1, func, penalty);
ffx = args.DLIK;
catch
fx = 1.e8;
end
......@@ -122,7 +126,8 @@ while i<n
while (fx-f0)==0 && iter<50
hess_info.h1(i) = hess_info.h1(i)*2;
xh1(i) = x(i)+hess_info.h1(i);
[fx, ~, ffx] = penalty_objective_function(xh1, func, penalty);
[fx, ~, args] = penalty_objective_function(xh1, func, penalty);
ffx = args.DLIK;
ic = 1;
iter = iter+1;
end
......@@ -144,7 +149,8 @@ while i<n
end
end
xh1(i) = x(i)-hess_info.h1(i);
[fx, ~, ffx] = penalty_objective_function(xh1, func, penalty);
[fx, ~, args] = penalty_objective_function(xh1, func, penalty);
ffx = args.DLIK;
f_1(:,i) = fx;
if outer_product_gradient
if any(isnan(ffx)) || isempty(ffx)
......
......@@ -64,7 +64,9 @@ if ischar(func0)
func0 = str2func(func0);
end
[fval0, ~, gg, hh] = penalty_objective_function(x,func0,penalty);
[fval0, ~, args] = penalty_objective_function(x,func0,penalty);
gg = args.DLIK;
hh = args.Hess;
fval = fval0;
% initialize mr_gstep and mr_hessian
......@@ -181,8 +183,8 @@ while norm(gg)>gtol && check==0 && jit<nit
disp_verbose('No further improvement is possible!', Verbose)
check = 1;
if analytic_derivation
[~, ~, gg, hh] = penalty_objective_function(xparam1, func0, penalty);
hhg = hh;
[~, ~, args] = penalty_objective_function(xparam1, func0, penalty);
hhg = args.Hess;
H = inv(hh);
else
if flagit==2
......@@ -256,8 +258,8 @@ while norm(gg)>gtol && check==0 && jit<nit
H = igg;
end
elseif analytic_derivation
[~, ~, gg, hh] = penalty_objective_function(xparam1, func0, penalty);
hhg = hh;
[~, ~, args] = penalty_objective_function(xparam1, func0, penalty);
hhg = args.Hess;
H = inv(hh);
end
disp_verbose(['Gradient norm ', num2str(norm(gg))], Verbose)
......
......@@ -2,7 +2,7 @@ function [g, badg] = numgrad3_(fcn, f0, x, penalty, epsilon)
% Computes the gradient of the objective function fcn using a three points formula if possible.
% Copyright (C) 2008-2019 Dynare Team
% Copyright © 2008-2019 Dynare Team
%
% This file is part of Dynare.
%
......@@ -37,12 +37,12 @@ for i=1:n
xiold = x(i);
h = step_length_correction(xiold,scale,i)*delta;
x(i) = xiold + h;
[f1,~,cost_flag1] = penalty_objective_function(x, fcn, penalty);
[f1, cost_flag1] = penalty_objective_function(x, fcn, penalty);
if ~cost_flag1
fprintf('Gradient w.r.t. parameter number %3d (x=%16.8f,+h=%16.8f,f0=%16.8f,f1=%16.8f,f2=%16.8f,g0=%16.8f): penalty on the right!\n',i,xiold,h,f0,f1,f2,(f1 - f2) / (2*h))
end
x(i) = xiold - h;
[f2,~,cost_flag2] = penalty_objective_function(x, fcn, penalty);
[f2, cost_flag2] = penalty_objective_function(x, fcn, penalty);
if ~cost_flag2
fprintf('Gradient w.r.t. parameter number %3d (x=%16.8f,+h=%16.8f,f0=%16.8f,f1=%16.8f,f2=%16.8f,g0=%16.8f): penalty on the left!\n',i,xiold,h,f0,f1,f2,(f1 - f2) / (2*h))
end
......
......@@ -6,7 +6,7 @@ function [g, badg] = numgrad5_(fcn, f0, x, penalty, epsilon)
%
% TODO Try Four points formula when cost_flag3=0 or cost_flag4=0.
% Copyright (C) 2008-2016 Dynare Team
% Copyright © 2008-2019 Dynare Team
% This file is part of Dynare.
%
% Dynare is free software: you can redistribute it and/or modify
......@@ -22,7 +22,7 @@ function [g, badg] = numgrad5_(fcn, f0, x, penalty, epsilon)
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
rescale_step_length = 0;
rescale_step_length = false;
delta = epsilon;
n = length(x);
......@@ -40,13 +40,13 @@ for i=1:n
xiold = x(i);
h = step_length_correction(xiold,scale,i)*delta;
x(i) = xiold+h;
[f1,~, cost_flag1] = penalty_objective_function(x, fcn, penalty);
f1 = penalty_objective_function(x, fcn, penalty);
x(i) = xiold-h;
[f2,~, cost_flag2] = penalty_objective_function(x, fcn, penalty);
f2 = penalty_objective_function(x, fcn, penalty);
x(i) = xiold+2*h;
[f3,~, cost_flag3] = penalty_objective_function(x, fcn, penalty);
f3 = penalty_objective_function(x, fcn, penalty);
x(i) = xiold-2*h;
[f4,~, cost_flag4] = penalty_objective_function(x, fcn, penalty);
f4 = penalty_objective_function(x, fcn, penalty);
if f0<f1 && f1<f3 && f0<f2 && f2<f4
g0 = 0;
else
......
function [fval, exit_flag, arg1, arg2] = penalty_objective_function(x, fcn, base_penalty)
function [fval, exitflag, args] = penalty_objective_function(x, fcn, base_penalty)
% Encapsulates an objective function to be minimized, adding a penalty if necessary.
%
......@@ -29,7 +29,7 @@ function [fval, exit_flag, arg1, arg2] = penalty_objective_function(x, fcn, base
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
[fval, info, exit_flag, arg1, arg2] = fcn(x);
[fval, info, exitflag, args] = fcn(x);
if info(1)
fval = base_penalty + info(4);
......
/*
* Copyright (C) 2015 Dynare Team
* Copyright © 2015-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -21,4 +21,6 @@
options_.lik_init = 1;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);
......@@ -21,4 +21,6 @@
options_.lik_init = 2;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);
/*
* Copyright (C) 2015 Dynare Team
* Copyright © 2015-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -21,4 +21,6 @@
options_.lik_init = 3;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);
/*
* Copyright (C) 2015 Dynare Team
* Copyright © 2015-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -21,4 +21,6 @@
options_.lik_init = 4;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);
/*
* Copyright (C) 2015 Dynare Team
* Copyright © 2015-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -21,4 +21,6 @@
options_.lik_init = 5;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);
/*
* Copyright (C) 2015 Dynare Team
* Copyright © 2015-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -21,4 +21,6 @@
options_.lik_init = 2;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);
/*
* Copyright (C) 2015 Dynare Team
* Copyright © 2015-2019 Dynare Team
*
* This file is part of Dynare.
*
......@@ -21,4 +21,6 @@
options_.lik_init = 3;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);
......@@ -21,4 +21,6 @@
options_.lik_init = 5;
oo_ = initial_estimation_checks(str2func('dsge_likelihood'),xparam1,dataset_,dataset_info,M_,estim_params_,options_,bayestopt_,bounds,oo_);
objfun = @(x) dsge_likelihood(x, dataset_, dataset_info, options_, M_, estim_params_, bayestopt_, bounds, oo_);
oo_ = initial_estimation_checks(objfun, xparam1, dataset_, M_, estim_params_, options_, bayestopt_, oo_);