Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynare
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Ratto
dynare
Commits
137368d5
Commit
137368d5
authored
12 years ago
by
Marco Ratto
Browse files
Options
Downloads
Patches
Plain Diff
Fixed bugs related to the case where no shock standard deviation is estimated
(manual cherry picked from
ad34f3db
)
parent
76a2aaff
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
matlab/gsa/map_ident_.m
+6
-1
6 additions, 1 deletion
matlab/gsa/map_ident_.m
matlab/gsa/redform_map.m
+21
-10
21 additions, 10 deletions
matlab/gsa/redform_map.m
matlab/prior_posterior_statistics.m
+6
-2
6 additions, 2 deletions
matlab/prior_posterior_statistics.m
with
33 additions
and
13 deletions
matlab/gsa/map_ident_.m
+
6
−
1
View file @
137368d5
...
...
@@ -836,7 +836,12 @@ else, % main effects analysis
imap
=
[
1
:
npT
];
x0
=
[
lpmat0
(
istable
,:),
lpmat
(
istable
,:)];
if
isempty
(
lpmat0
),
x0
=
lpmat
(
istable
,:);
else
x0
=
[
lpmat0
(
istable
,:),
lpmat
(
istable
,:)];
end
nrun
=
length
(
istable
);
nest
=
min
(
250
,
nrun
);
nfit
=
min
(
1000
,
nrun
);
...
...
This diff is collapsed.
Click to expand it.
matlab/gsa/redform_map.m
+
21
−
10
View file @
137368d5
...
...
@@ -87,7 +87,13 @@ adir0=pwd;
nspred
=
size
(
T
,
2
)
-
M_
.
exo_nbr
;
x0
=
lpmat
(
istable
,:);
xx0
=
lpmat0
(
istable
,:);
if
isempty
(
lpmat0
),
xx0
=
[];
nshocks
=
0
;
else
xx0
=
lpmat0
(
istable
,:);
nshocks
=
size
(
xx0
,
2
);
end
[
kn
,
np
]
=
size
(
x0
);
offset
=
length
(
bayestopt_
.
pshape
)
-
np
;
if
options_gsa_
.
prior_range
,
...
...
@@ -99,7 +105,8 @@ else
end
nsok
=
length
(
find
(
M_
.
lead_lag_incidence
(
M_
.
maximum_lag
,:)));
clear
lpmat
lpmat0
lpmat
=
[];
lpmat0
=
[];
js
=
0
;
for
j
=
1
:
size
(
anamendo
,
1
)
namendo
=
deblank
(
anamendo
(
j
,:));
...
...
@@ -147,7 +154,7 @@ for j=1:size(anamendo,1)
% else
si
(:,
js
)
=
NaN
(
np
,
1
);
% end
if
~
isempty
(
iy
)
&&
~
isempty
(
iyc
)
if
length
(
iy
)
>
size
(
x0
,
2
)
&&
length
(
iyc
)
>
size
(
x0
,
2
)
delete
([
xdir
,
'/*threshold*.*'
])
[
proba
,
dproba
]
=
stab_map_1
(
x0
,
iy
,
iyc
,
'threshold'
,
0
);
% indsmirnov = find(dproba>ksstat);
...
...
@@ -156,14 +163,16 @@ for j=1:size(anamendo,1)
disp
([
M_
.
param_names
(
estim_params_
.
param_vals
(
indsmirnov
(
jp
),
1
),:),
' d-stat = '
,
num2str
(
dproba
(
indsmirnov
(
jp
)),
'%1.3f'
),
' p-value = '
,
num2str
(
proba
(
indsmirnov
(
jp
)),
'%1.3f'
)])
end
disp
(
' '
);
stab_map_1
(
x0
,
iy
,
iyc
,
'threshold'
,
1
,
indsmirnov
,
xdir
);
stab_map_1
(
x0
,
iy
,
iyc
,
'threshold'
,
pvalue_ks
,
indsmirnov
,
xdir
);
stab_map_2
(
x0
(
iy
,:),
alpha2
,
pvalue_corr
,
'inside_threshold'
,
xdir
)
stab_map_2
(
x0
(
iyc
,:),
alpha2
,
pvalue_corr
,
'outside_threshold'
,
xdir
)
lpmat
=
x0
(
iy
,:);
lpmat0
=
xx0
(
iy
,:);
if
nshocks
,
lpmat0
=
xx0
(
iy
,:);
end
istable
=
[
1
:
length
(
iy
)];
save
([
xdir
,
filesep
,
'threshold.mat'
],
'lpmat'
,
'lpmat0'
,
'istable'
,
'y0'
,
'x0'
,
'xx0'
,
'iy'
,
'iyc'
)
clear
lpmat
lpmat0
istable
lpmat
=
[];
lpmat0
=
[];
istable
=
[];
end
end
else
...
...
@@ -244,7 +253,7 @@ for j=1:size(anamendo,1)
hf
=
dyn_figure
(
options_
);
hist
(
y0
,
30
),
title
([
namendo
,
' vs. '
,
namlagendo
])
dyn_saveas
(
hf
,[
xdir
,
'/'
,
namendo
,
'_vs_'
,
namlagendo
],
options_
);
end
if
~
isempty
(
iy
)
&&
~
isempty
(
iyc
),
if
length
(
iy
)
>
size
(
x0
,
2
)
&&
length
(
iyc
)
>
size
(
x0
,
2
),
delete
([
xdir
,
'/*threshold*.*'
])
[
proba
,
dproba
]
=
stab_map_1
(
x0
,
iy
,
iyc
,
'threshold'
,
0
);
% indsmirnov = find(dproba>ksstat);
...
...
@@ -253,14 +262,16 @@ for j=1:size(anamendo,1)
disp
([
M_
.
param_names
(
estim_params_
.
param_vals
(
indsmirnov
(
jp
),
1
),:),
' d-stat = '
,
num2str
(
dproba
(
indsmirnov
(
jp
)),
'%1.3f'
),
' p-value = '
,
num2str
(
proba
(
indsmirnov
(
jp
)),
'%1.3f'
)])
end
disp
(
' '
);
stab_map_1
(
x0
,
iy
,
iyc
,
'threshold'
,
1
,
indsmirnov
,
xdir
);
stab_map_1
(
x0
,
iy
,
iyc
,
'threshold'
,
pvalue_ks
,
indsmirnov
,
xdir
);
stab_map_2
(
x0
(
iy
,:),
alpha2
,
pvalue_corr
,
'inside_threshold'
,
xdir
)
stab_map_2
(
x0
(
iyc
,:),
alpha2
,
pvalue_corr
,
'outside_threshold'
,
xdir
)
lpmat
=
x0
(
iy
,:);
lpmat0
=
xx0
(
iy
,:);
if
nshocks
,
lpmat0
=
xx0
(
iy
,:);
end
istable
=
[
1
:
length
(
iy
)];
save
([
xdir
,
filesep
,
'threshold.mat'
],
'lpmat'
,
'lpmat0'
,
'istable'
,
'y0'
,
'x0'
,
'xx0'
,
'iy'
,
'iyc'
)
clear
lpmat
lpmat0
istable
lpmat
=
[];
lpmat0
=
[];
istable
=
[];
end
end
...
...
This diff is collapsed.
Click to expand it.
matlab/prior_posterior_statistics.m
+
6
−
2
View file @
137368d5
...
...
@@ -94,8 +94,12 @@ elseif strcmpi(type,'gsa')
DirectoryName
=
CheckPath
([
'gsa'
,
filesep
,
'mc'
],
M_
.
dname
);
load
([
RootDirectoryName
filesep
M_
.
fname
'_mc.mat'
],
'lpmat0'
,
'lpmat'
,
'istable'
)
end
x
=
[
lpmat0
(
istable
,:)
lpmat
(
istable
,:)];
clear
lpmat
istable
if
~
isempty
(
lpmat0
),
x
=
[
lpmat0
(
istable
,:)
lpmat
(
istable
,:)];
else
x
=
lpmat
(
istable
,:);
end
clear
lpmat
lpmat0
istable
NumberOfDraws
=
size
(
x
,
1
);
B
=
NumberOfDraws
;
elseif
strcmpi
(
type
,
'prior'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment