diff --git a/matlab/dynare_estimation_init.m b/matlab/dynare_estimation_init.m
index 5ee9a9fa717cd46a348c0d5f6ab2d94f64a9aa11..0d3824fd5f5b89bd5867871399558db2544a4020 100644
--- a/matlab/dynare_estimation_init.m
+++ b/matlab/dynare_estimation_init.m
@@ -310,6 +310,9 @@ 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
 end
+if all(bayestopt_.pshape==0) && any(isnan(xparam1))
+    error('ML estimation requires all estimated parameters to be initialized, either in an estimated_params or estimated_params_init-block ')
+end
 
 if ~isempty(estim_params_) && ~(all(strcmp(fieldnames(estim_params_),'full_calibration_detected'))  || (isfield(estim_params_,'nvx') && sum(estim_params_.nvx+estim_params_.nvn+estim_params_.ncx+estim_params_.ncn+estim_params_.np)==0))
     if ~isempty(bayestopt_) && any(bayestopt_.pshape > 0)