diff --git a/matlab/dynare_identification.m b/matlab/dynare_identification.m index 1e96f8b72..1547604cf 100644 --- a/matlab/dynare_identification.m +++ b/matlab/dynare_identification.m @@ -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, diff --git a/matlab/identification_analysis.m b/matlab/identification_analysis.m index 07f5ce50f..c30ed8a19 100644 --- a/matlab/identification_analysis.m +++ b/matlab/identification_analysis.m @@ -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 diff --git a/matlab/identification_checks.m b/matlab/identification_checks.m index 3546b0146..78b12e174 100644 --- a/matlab/identification_checks.m +++ b/matlab/identification_checks.m @@ -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);