Skip to content
Snippets Groups Projects
Verified Commit bd3ca587 authored by Willi Mutschler's avatar Willi Mutschler
Browse files

method_of_moments: remove spurious diag(diag(x))

parent 65f8b56f
No related branches found
No related tags found
1 merge request!2191IRF Matching
...@@ -337,7 +337,7 @@ elseif strcmp(options_mom_.mom.mom_method,'GMM') || strcmp(options_mom_.mom.mom_ ...@@ -337,7 +337,7 @@ elseif strcmp(options_mom_.mom.mom_method,'GMM') || strcmp(options_mom_.mom.mom_
if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output
fval = residuals; fval = residuals;
if options_mom_.mom.penalized_estimator if options_mom_.mom.penalized_estimator
fval=[fval;(xparam-bayestopt_.p1)./sqrt(diag(diag(bayestopt_.p2.^2)))]; fval=[fval;(xparam-bayestopt_.p1)./bayestopt_.p2];
end end
else else
fval = Q; fval = Q;
...@@ -354,7 +354,7 @@ elseif strcmp(options_mom_.mom.mom_method,'GMM') || strcmp(options_mom_.mom.mom_ ...@@ -354,7 +354,7 @@ elseif strcmp(options_mom_.mom.mom_method,'GMM') || strcmp(options_mom_.mom.mom_
dresiduals = sqrt(options_mom_.mom.weighting_matrix_scaling_factor)*weighting_info.Sw*dmoments_difference; dresiduals = sqrt(options_mom_.mom.weighting_matrix_scaling_factor)*weighting_info.Sw*dmoments_difference;
if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output
if options_mom_.mom.penalized_estimator if options_mom_.mom.penalized_estimator
df(:,jp)=[dresiduals;dxparam(:,jp)./sqrt(diag(diag(bayestopt_.p2.^2)))]; df(:,jp)=[dresiduals;dxparam(:,jp)./bayestopt_.p2];
else else
df(:,jp) = dresiduals; df(:,jp) = dresiduals;
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment