Trap the case where only one parameter is estimated and only one non-constant row is available in Jacobian: (1) do not use vnorm; (2) do not use advanced option.
(cherry picked from commit d9856879ea4d9a7d9e954cc9392d1f0e98634cda)time-shift
parent
b8e3ce0cfd
commit
d969a8129c
|
@ -207,15 +207,23 @@ else
|
||||||
name_tex = [cellstr(M_.exo_names_tex); cellstr(M_.param_names_tex)];
|
name_tex = [cellstr(M_.exo_names_tex); cellstr(M_.param_names_tex)];
|
||||||
end
|
end
|
||||||
|
|
||||||
|
skipline()
|
||||||
|
disp(['==== Identification analysis ====' ]),
|
||||||
|
skipline()
|
||||||
|
if nparam<2,
|
||||||
|
options_ident.advanced=0;
|
||||||
|
advanced = options_ident.advanced;
|
||||||
|
disp('There is only one parameter to study for identitification.')
|
||||||
|
disp('The advanced option is re-set to 0.')
|
||||||
|
skipline()
|
||||||
|
end
|
||||||
|
|
||||||
options_ident = set_default_option(options_ident,'max_dim_cova_group',min([2,nparam-1]));
|
options_ident = set_default_option(options_ident,'max_dim_cova_group',min([2,nparam-1]));
|
||||||
options_ident.max_dim_cova_group = min([options_ident.max_dim_cova_group,nparam-1]);
|
options_ident.max_dim_cova_group = min([options_ident.max_dim_cova_group,nparam-1]);
|
||||||
|
|
||||||
|
|
||||||
MaxNumberOfBytes=options_.MaxNumberOfBytes;
|
MaxNumberOfBytes=options_.MaxNumberOfBytes;
|
||||||
store_options_ident = options_ident;
|
store_options_ident = options_ident;
|
||||||
skipline()
|
|
||||||
disp(['==== Identification analysis ====' ]),
|
|
||||||
skipline()
|
|
||||||
|
|
||||||
if iload <=0,
|
if iload <=0,
|
||||||
|
|
||||||
|
|
|
@ -225,7 +225,11 @@ if info(1)==0,
|
||||||
deltaM = deltaM.*abs(params');
|
deltaM = deltaM.*abs(params');
|
||||||
deltaM(params==0)=deltaM_prior(params==0);
|
deltaM(params==0)=deltaM_prior(params==0);
|
||||||
quant = siJ./repmat(sqrt(diag(cmm)),1,nparam);
|
quant = siJ./repmat(sqrt(diag(cmm)),1,nparam);
|
||||||
siJnorm = vnorm(quant).*normaliz1;
|
if size(quant,1)==1,
|
||||||
|
siJnorm = abs(quant).*normaliz1;
|
||||||
|
else
|
||||||
|
siJnorm = vnorm(quant).*normaliz1;
|
||||||
|
end
|
||||||
% siJnorm = vnorm(siJ(inok,:)).*normaliz;
|
% siJnorm = vnorm(siJ(inok,:)).*normaliz;
|
||||||
quant=[];
|
quant=[];
|
||||||
% inok = find((abs(TAU)<1.e-8));
|
% inok = find((abs(TAU)<1.e-8));
|
||||||
|
@ -238,7 +242,11 @@ if info(1)==0,
|
||||||
siH=siH(iy,:);
|
siH=siH(iy,:);
|
||||||
if ~isempty(iy),
|
if ~isempty(iy),
|
||||||
quant = siH./repmat(sqrt(diag_chh(iy)),1,nparam);
|
quant = siH./repmat(sqrt(diag_chh(iy)),1,nparam);
|
||||||
siHnorm = vnorm(quant).*normaliz1;
|
if size(quant,1)==1,
|
||||||
|
siHnorm = abs(quant).*normaliz1;
|
||||||
|
else
|
||||||
|
siHnorm = vnorm(quant).*normaliz1;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
siHnorm = [];
|
siHnorm = [];
|
||||||
end
|
end
|
||||||
|
@ -254,7 +262,11 @@ if info(1)==0,
|
||||||
siLRE=siLRE(iy,:);
|
siLRE=siLRE(iy,:);
|
||||||
if ~isempty(iy),
|
if ~isempty(iy),
|
||||||
quant = siLRE./repmat(sqrt(diag_clre(iy)),1,np);
|
quant = siLRE./repmat(sqrt(diag_clre(iy)),1,np);
|
||||||
siLREnorm = vnorm(quant).*normaliz1(offset+1:end);
|
if size(quant,1)==1,
|
||||||
|
siLREnorm = abs(quant).*normaliz1(offset+1:end);
|
||||||
|
else
|
||||||
|
siLREnorm = vnorm(quant).*normaliz1(offset+1:end);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
siLREnorm=[];
|
siLREnorm=[];
|
||||||
end
|
end
|
||||||
|
|
|
@ -45,7 +45,11 @@ function [condJ, ind0, indnoJ, ixnoJ, McoJ, PcoJ, jweak, jweak_pair] = identific
|
||||||
npar = size(JJ,2);
|
npar = size(JJ,2);
|
||||||
indnoJ = zeros(1,npar);
|
indnoJ = zeros(1,npar);
|
||||||
|
|
||||||
ind1 = find(vnorm(JJ)>=eps); % take non-zero columns
|
if size(JJ,1)>1,
|
||||||
|
ind1 = find(vnorm(JJ)>=eps); % take non-zero columns
|
||||||
|
else
|
||||||
|
ind1 = find(abs(JJ)>=eps); % take non-zero columns
|
||||||
|
end
|
||||||
JJ1 = JJ(:,ind1);
|
JJ1 = JJ(:,ind1);
|
||||||
[eu,ee2,ee1] = svd( JJ1, 0 );
|
[eu,ee2,ee1] = svd( JJ1, 0 );
|
||||||
condJ= cond(JJ1);
|
condJ= cond(JJ1);
|
||||||
|
|
Loading…
Reference in New Issue