method_of_moments: remove spurious diag(diag(x))

covariance-quadratic-approximation
Willi Mutschler 2023-12-13 13:01:55 +01:00
parent 65f8b56fb0
commit bd3ca58727
No known key found for this signature in database
GPG Key ID: 91E724BF17A73F6D
1 changed files with 2 additions and 2 deletions

View File

@ -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
fval = residuals;
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
else
fval = Q;
@ -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;
if options_mom_.mom.vector_output == 1 % lsqnonlin requires vector output
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
df(:,jp) = dresiduals;
end