Merge remote-tracking branch 'ratto/master'

time-shift
Sébastien Villemot 2011-09-01 17:03:52 +02:00
commit d91c4ac1a9
4 changed files with 29 additions and 16 deletions

View File

@ -58,6 +58,7 @@ options_ident = set_default_option(options_ident,'prior_range',0);
options_ident = set_default_option(options_ident,'periods',300);
options_ident = set_default_option(options_ident,'replic',100);
options_ident = set_default_option(options_ident,'advanced',0);
options_ident = set_default_option(options_ident,'normalize_jacobians',1);
options_ident = set_default_option(options_ident,'lik_init',1);
if options_ident.gsa_sample_file,
GSAFolder = checkpath('GSA');

View File

@ -56,6 +56,7 @@ advanced = options_ident.advanced;
replic = options_ident.replic;
periods = options_ident.periods;
max_dim_cova_group = options_ident.max_dim_cova_group;
normalize_jacobians = options_ident.normalize_jacobians;
[I,J]=find(M_.lead_lag_incidence');
ide_hess = struct();
@ -230,9 +231,18 @@ if info(1)==0,
ide_lre.siLREnorm=siLREnorm;
ide_hess.flag_score=flag_score;
end,
normH = max(abs(siH)')';
normJ = max(abs(siJ)')';
normLRE = max(abs(siLRE)')';
if normalize_jacobians,
normH = max(abs(siH)')';
normH = normH(:,ones(nparam,1));
normJ = max(abs(siJ)')';
normJ = normJ(:,ones(nparam,1));
normLRE = max(abs(siLRE)')';
normLRE = normLRE(:,ones(size(gp,2),1));
else
normH = 1;
normJ = 1;
normLRE = 1;
end
ide_moments.indJJ=indJJ;
ide_model.indH=indH;
ide_lre.indLRE=indLRE;
@ -251,12 +261,13 @@ if info(1)==0,
% ide_checks.idemodel_ino, ide_checks.idemoments_ino] = ...
% identification_checks(H(indH,:)./normH(:,ones(nparam,1)),JJ(indJJ,:)./normJ(:,ones(nparam,1)), gp(indLRE,:)./normLRE(:,ones(size(gp,2),1)));
[ide_moments.cond, ide_moments.ind0, ide_moments.indno, ide_moments.ino, ide_moments.Mco, ide_moments.Pco, ide_moments.jweak, ide_moments.jweak_pair] = ...
identification_checks(JJ(indJJ,:)./normJ(:,ones(nparam,1)), 0);
identification_checks(JJ(indJJ,:)./normJ, 0);
[ide_model.cond, ide_model.ind0, ide_model.indno, ide_model.ino, ide_model.Mco, ide_model.Pco, ide_model.jweak, ide_model.jweak_pair] = ...
identification_checks(H(indH,:)./normH(:,ones(nparam,1)), 0);
identification_checks(H(indH,:)./normH, 0);
[ide_lre.cond, ide_lre.ind0, ide_lre.indno, ide_lre.ino, ide_lre.Mco, ide_lre.Pco, ide_lre.jweak, ide_lre.jweak_pair] = ...
identification_checks(gp(indLRE,:)./normLRE(:,ones(size(gp,2),1)), 0);
[U, S, V]=svd(JJ(indJJ,:)./normJ(:,ones(nparam,1)),0);
identification_checks(gp(indLRE,:)./normLRE, 0);
normJ=1;
[U, S, V]=svd(JJ(indJJ,:)./normJ,0);
S=diag(S);
if nparam>8
ide_moments.S = S([1:4, end-3:end]);
@ -268,6 +279,6 @@ if info(1)==0,
indok = find(max(ide_moments.indno,[],1)==0);
if advanced,
[ide_moments.pars, ide_moments.cosnJ] = ident_bruteforce(JJ(indJJ,:)./normJ(:,ones(nparam,1)),max_dim_cova_group,options_.TeX,name_tex);
[ide_moments.pars, ide_moments.cosnJ] = ident_bruteforce(JJ(indJJ,:)./normJ,max_dim_cova_group,options_.TeX,name_tex);
end
end

View File

@ -49,11 +49,11 @@ ind1 = find(vnorm(JJ)>=eps); % take non-zero columns
JJ1 = JJ(:,ind1);
[eu,ee2,ee1] = svd( JJ1, 0 );
condJ= cond(JJ1);
rankJ = rank(JJ);
rankJ = rank(JJ./norm(JJ),1.e-10);
rankJJ = rankJ;
if hess_flag==0,
rankJJ = rank(JJ'*JJ);
end
% if hess_flag==0,
% rankJJ = rank(JJ'*JJ);
% end
ind0 = zeros(1,npar);
ind0(ind1) = 1;

View File

@ -56,7 +56,6 @@ tittxt1=regexprep(tittxt, ' ', '_');
tittxt1=strrep(tittxt1, '.', '');
if SampleSize == 1,
siJ = idemoments.siJ;
normJ = max(abs(siJ)')';
figure('Name',[tittxt, ' - Identification using info from observables']),
subplot(211)
mmm = (idehess.ide_strength_J);
@ -171,6 +170,7 @@ if SampleSize == 1,
disp('')
if idehess.flag_score,
[U,S,V]=svd(idehess.AHess,0);
S=diag(S);
if nparam<5,
f1 = figure('name',[tittxt,' - Identification patterns (Information matrix)']);
else
@ -178,7 +178,8 @@ if SampleSize == 1,
f2 = figure('name',[tittxt,' - Identification patterns (Information matrix): HIGHEST SV']);
end
else
[U,S,V]=svd(siJ./normJ(:,ones(nparam,1)),0);
S = idemoments.S;
V = idemoments.V;
if nparam<5,
f1 = figure('name',[tittxt,' - Identification patterns (moments)']);
else
@ -197,10 +198,10 @@ if SampleSize == 1,
subplot(4,1,jj),
if j<5
bar(abs(V(:,end-j+1))),
Stit = S(end-j+1,end-j+1);
Stit = S(end-j+1);
else
bar(abs(V(:,jj))),
Stit = S(jj,jj);
Stit = S(jj);
end
set(gca,'xticklabel','')
if j==4 || j==nparam || j==8,