Merge remote-tracking branch 'ratto/master'
commit
d91c4ac1a9
|
@ -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,'periods',300);
|
||||||
options_ident = set_default_option(options_ident,'replic',100);
|
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,'advanced',0);
|
||||||
|
options_ident = set_default_option(options_ident,'normalize_jacobians',1);
|
||||||
options_ident = set_default_option(options_ident,'lik_init',1);
|
options_ident = set_default_option(options_ident,'lik_init',1);
|
||||||
if options_ident.gsa_sample_file,
|
if options_ident.gsa_sample_file,
|
||||||
GSAFolder = checkpath('GSA');
|
GSAFolder = checkpath('GSA');
|
||||||
|
|
|
@ -56,6 +56,7 @@ advanced = options_ident.advanced;
|
||||||
replic = options_ident.replic;
|
replic = options_ident.replic;
|
||||||
periods = options_ident.periods;
|
periods = options_ident.periods;
|
||||||
max_dim_cova_group = options_ident.max_dim_cova_group;
|
max_dim_cova_group = options_ident.max_dim_cova_group;
|
||||||
|
normalize_jacobians = options_ident.normalize_jacobians;
|
||||||
[I,J]=find(M_.lead_lag_incidence');
|
[I,J]=find(M_.lead_lag_incidence');
|
||||||
|
|
||||||
ide_hess = struct();
|
ide_hess = struct();
|
||||||
|
@ -230,9 +231,18 @@ if info(1)==0,
|
||||||
ide_lre.siLREnorm=siLREnorm;
|
ide_lre.siLREnorm=siLREnorm;
|
||||||
ide_hess.flag_score=flag_score;
|
ide_hess.flag_score=flag_score;
|
||||||
end,
|
end,
|
||||||
normH = max(abs(siH)')';
|
if normalize_jacobians,
|
||||||
normJ = max(abs(siJ)')';
|
normH = max(abs(siH)')';
|
||||||
normLRE = max(abs(siLRE)')';
|
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_moments.indJJ=indJJ;
|
||||||
ide_model.indH=indH;
|
ide_model.indH=indH;
|
||||||
ide_lre.indLRE=indLRE;
|
ide_lre.indLRE=indLRE;
|
||||||
|
@ -251,12 +261,13 @@ if info(1)==0,
|
||||||
% ide_checks.idemodel_ino, ide_checks.idemoments_ino] = ...
|
% 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)));
|
% 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] = ...
|
[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] = ...
|
[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] = ...
|
[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);
|
identification_checks(gp(indLRE,:)./normLRE, 0);
|
||||||
[U, S, V]=svd(JJ(indJJ,:)./normJ(:,ones(nparam,1)),0);
|
normJ=1;
|
||||||
|
[U, S, V]=svd(JJ(indJJ,:)./normJ,0);
|
||||||
S=diag(S);
|
S=diag(S);
|
||||||
if nparam>8
|
if nparam>8
|
||||||
ide_moments.S = S([1:4, end-3:end]);
|
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);
|
indok = find(max(ide_moments.indno,[],1)==0);
|
||||||
if advanced,
|
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
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,11 +49,11 @@ ind1 = find(vnorm(JJ)>=eps); % take non-zero columns
|
||||||
JJ1 = JJ(:,ind1);
|
JJ1 = JJ(:,ind1);
|
||||||
[eu,ee2,ee1] = svd( JJ1, 0 );
|
[eu,ee2,ee1] = svd( JJ1, 0 );
|
||||||
condJ= cond(JJ1);
|
condJ= cond(JJ1);
|
||||||
rankJ = rank(JJ);
|
rankJ = rank(JJ./norm(JJ),1.e-10);
|
||||||
rankJJ = rankJ;
|
rankJJ = rankJ;
|
||||||
if hess_flag==0,
|
% if hess_flag==0,
|
||||||
rankJJ = rank(JJ'*JJ);
|
% rankJJ = rank(JJ'*JJ);
|
||||||
end
|
% end
|
||||||
|
|
||||||
ind0 = zeros(1,npar);
|
ind0 = zeros(1,npar);
|
||||||
ind0(ind1) = 1;
|
ind0(ind1) = 1;
|
||||||
|
|
|
@ -56,7 +56,6 @@ tittxt1=regexprep(tittxt, ' ', '_');
|
||||||
tittxt1=strrep(tittxt1, '.', '');
|
tittxt1=strrep(tittxt1, '.', '');
|
||||||
if SampleSize == 1,
|
if SampleSize == 1,
|
||||||
siJ = idemoments.siJ;
|
siJ = idemoments.siJ;
|
||||||
normJ = max(abs(siJ)')';
|
|
||||||
figure('Name',[tittxt, ' - Identification using info from observables']),
|
figure('Name',[tittxt, ' - Identification using info from observables']),
|
||||||
subplot(211)
|
subplot(211)
|
||||||
mmm = (idehess.ide_strength_J);
|
mmm = (idehess.ide_strength_J);
|
||||||
|
@ -171,6 +170,7 @@ if SampleSize == 1,
|
||||||
disp('')
|
disp('')
|
||||||
if idehess.flag_score,
|
if idehess.flag_score,
|
||||||
[U,S,V]=svd(idehess.AHess,0);
|
[U,S,V]=svd(idehess.AHess,0);
|
||||||
|
S=diag(S);
|
||||||
if nparam<5,
|
if nparam<5,
|
||||||
f1 = figure('name',[tittxt,' - Identification patterns (Information matrix)']);
|
f1 = figure('name',[tittxt,' - Identification patterns (Information matrix)']);
|
||||||
else
|
else
|
||||||
|
@ -178,7 +178,8 @@ if SampleSize == 1,
|
||||||
f2 = figure('name',[tittxt,' - Identification patterns (Information matrix): HIGHEST SV']);
|
f2 = figure('name',[tittxt,' - Identification patterns (Information matrix): HIGHEST SV']);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
[U,S,V]=svd(siJ./normJ(:,ones(nparam,1)),0);
|
S = idemoments.S;
|
||||||
|
V = idemoments.V;
|
||||||
if nparam<5,
|
if nparam<5,
|
||||||
f1 = figure('name',[tittxt,' - Identification patterns (moments)']);
|
f1 = figure('name',[tittxt,' - Identification patterns (moments)']);
|
||||||
else
|
else
|
||||||
|
@ -197,10 +198,10 @@ if SampleSize == 1,
|
||||||
subplot(4,1,jj),
|
subplot(4,1,jj),
|
||||||
if j<5
|
if j<5
|
||||||
bar(abs(V(:,end-j+1))),
|
bar(abs(V(:,end-j+1))),
|
||||||
Stit = S(end-j+1,end-j+1);
|
Stit = S(end-j+1);
|
||||||
else
|
else
|
||||||
bar(abs(V(:,jj))),
|
bar(abs(V(:,jj))),
|
||||||
Stit = S(jj,jj);
|
Stit = S(jj);
|
||||||
end
|
end
|
||||||
set(gca,'xticklabel','')
|
set(gca,'xticklabel','')
|
||||||
if j==4 || j==nparam || j==8,
|
if j==4 || j==nparam || j==8,
|
||||||
|
|
Loading…
Reference in New Issue