Skip to content

Initialize not computed derivative matrices with NaN instead of zero

We have for example

          if (mod_file_struct.identification_present 
              || mod_file_struct.estimation_analytic_derivation
              || (mod_file_struct.GMM_present && (mod_file_struct.analytic_standard_errors_present || mod_file_struct.analytic_jacobian_present)))
            paramsDerivsOrder = params_derivs_order;

Hence, dynamic_params_derivs.m returns zero matrices if no command like identification is present. It is dangerous to return a wrong result with conformable dimensions because users can call the correct functions to get the parameter derivatives, but the results will not make sense because everything was zero. We should initialize with NaN. The same may be present with derivatives with respect to endogenous variables.