Commit d969a812 authored by Marco Ratto's avatar Marco Ratto
Browse files

Trap the case where only one parameter is estimated and only one non-constant...

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 d9856879)
parent b8e3ce0c
......@@ -207,15 +207,23 @@ else
name_tex = [cellstr(M_.exo_names_tex); cellstr(M_.param_names_tex)];
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.max_dim_cova_group = min([options_ident.max_dim_cova_group,nparam-1]);
MaxNumberOfBytes=options_.MaxNumberOfBytes;
store_options_ident = options_ident;
skipline()
disp(['==== Identification analysis ====' ]),
skipline()
if iload <=0,
......
......@@ -225,7 +225,11 @@ if info(1)==0,
deltaM = deltaM.*abs(params');
deltaM(params==0)=deltaM_prior(params==0);
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;
quant=[];
% inok = find((abs(TAU)<1.e-8));
......@@ -238,7 +242,11 @@ if info(1)==0,
siH=siH(iy,:);
if ~isempty(iy),
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
siHnorm = [];
end
......@@ -254,7 +262,11 @@ if info(1)==0,
siLRE=siLRE(iy,:);
if ~isempty(iy),
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
siLREnorm=[];
end
......
......@@ -45,7 +45,11 @@ function [condJ, ind0, indnoJ, ixnoJ, McoJ, PcoJ, jweak, jweak_pair] = identific
npar = size(JJ,2);
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);
[eu,ee2,ee1] = svd( JJ1, 0 );
condJ= cond(JJ1);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment