0001 function DynareResults = initial_estimation_checks(objective_function,xparam1,DynareDataset,Model,EstimatedParameters,DynareOptions,BayesInfo,DynareResults)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 if DynareDataset.info.nvobs>Model.exo_nbr+EstimatedParameters.nvn
0034 error(['initial_estimation_checks:: Estimation can''t take place because there are less shocks than observed variables!'])
0035 end
0036
0037
0038 [DynareResults.steady_state] = evaluate_steady_state(DynareResults.steady_state,Model,DynareOptions,DynareResults,DynareOptions.diffuse_filter==0);
0039
0040
0041 [fval,junk1,junk2,a,b,c,d] = feval(objective_function,xparam1,DynareDataset,DynareOptions,Model,EstimatedParameters,BayesInfo,DynareResults);
0042
0043 if DynareOptions.dsge_var || strcmp(func2str(objective_function),'non_linear_dsge_likelihood')
0044 info = b;
0045 else
0046 info = d;
0047 end
0048
0049 if DynareOptions.mode_compute==5
0050 if ~strcmp(func2str(objective_function),'dsge_likelihood')
0051 error('Options mode_compute=5 is not compatible with non linear filters or Dsge-VAR models!')
0052 end
0053 end
0054
0055 if info(1) > 0
0056 disp('Error in computing likelihood for initial parameter values')
0057 print_info(info, DynareOptions.noprint)
0058 end
0059
0060 if any(abs(DynareResults.steady_state(BayesInfo.mfys))>1e-9) && (DynareOptions.prefilter==1)
0061 disp(['You are trying to estimate a model with a non zero steady state for the observed endogenous'])
0062 disp(['variables using demeaned data!'])
0063 error('You should change something in your mod file...')
0064 end
0065
0066 disp(['Initial value of the log posterior (or likelihood): ' num2str(-fval)]);