Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
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
Frédéric Karamé
dynare
Commits
3cbdec01
Commit
3cbdec01
authored
11 years ago
by
Stéphane Adjemian
Browse files
Options
Downloads
Patches
Plain Diff
Bug fixes (related to the loading of the mcmc files) + Cosmetic changes.
(cherry picked from commit
832f8ee8
)
parent
a47d0288
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/check_posterior_analysis_data.m
+11
-11
11 additions, 11 deletions
matlab/check_posterior_analysis_data.m
matlab/get_name_of_the_last_mh_file.m
+2
-2
2 additions, 2 deletions
matlab/get_name_of_the_last_mh_file.m
with
13 additions
and
13 deletions
matlab/check_posterior_analysis_data.m
+
11
−
11
View file @
3cbdec01
...
...
@@ -22,16 +22,18 @@ if nargout>1
description
=
''
;
end
%% Get informations about mcmc files.
MetropolisFolder
=
CheckPath
(
'metropolis'
,
M_
.
dname
);
% Get informations about mcmc files.
if
~
exist
([
M_
.
dname
'/metropolis'
],
'dir'
)
disp
(
'check_posterior_analysis_data:: Can
''
t find any mcmc file!'
)
return
end
mhname
=
get_name_of_the_last_mh_file
(
M_
);
mhdate
=
get_date_of_a_file
(
mhname
);
mhdate
=
get_date_of_a_file
(
[
MetropolisFolder
filesep
mhname
]
);
%
% Get informations about _posterior_draws files.
drawsinfo
=
dir
([
M
_
.
dname
'/metropolis/'
M_
.
fname
'_posterior_draws*.mat'
]);
% Get informations about _posterior_draws files.
drawsinfo
=
dir
([
M
etropolisFolder
filesep
M_
.
fname
'_posterior_draws*.mat'
]);
if
isempty
(
drawsinfo
)
info
=
1
;
% select_posterior_draws has to be called first.
if
nargout
>
1
...
...
@@ -40,8 +42,7 @@ if isempty(drawsinfo)
return
else
number_of_last_posterior_draws_file
=
length
(
drawsinfo
);
pddate
=
get_date_of_a_file
([
M_
.
dname
'/metropolis/'
M_
.
fname
'_posterior_draws'
...
int2str
(
number_of_last_posterior_draws_file
)
'.mat'
]);
pddate
=
get_date_of_a_file
([
MetropolisFolder
filesep
M_
.
fname
'_posterior_draws'
int2str
(
number_of_last_posterior_draws_file
)
'.mat'
]);
if
pddate
<
mhdate
info
=
2
;
% _posterior_draws files have to be updated.
if
nargout
>
1
...
...
@@ -56,7 +57,7 @@ else
end
end
%
% Get informations about posterior data files.
% Get informations about posterior data files.
switch
type
case
'variance'
generic_post_data_file_name
=
'Posterior2ndOrderMoments'
;
...
...
@@ -69,7 +70,7 @@ switch type
otherwise
disp
(
'This feature is not yest implemented!'
)
end
pdfinfo
=
dir
([
M
_
.
dname
'/metropolis/'
M_
.
fname
'_'
generic_post_data_file_name
'*'
]);
pdfinfo
=
dir
([
M
etropolisFolder
filesep
M_
.
fname
'_'
generic_post_data_file_name
'*'
]);
if
isempty
(
pdfinfo
)
info
=
4
;
% posterior draws have to be processed.
if
nargout
>
1
...
...
@@ -79,8 +80,7 @@ if isempty(pdfinfo)
else
number_of_the_last_post_data_file
=
length
(
pdfinfo
);
name_of_the_last_post_data_file
=
...
[
pwd
filesep
M_
.
dname
...
filesep
'metropolis'
filesep
...
[
pwd
filesep
MetropolisFolder
filesep
...
M_
.
fname
'_'
...
generic_post_data_file_name
...
int2str
(
number_of_the_last_post_data_file
)
...
...
...
@@ -95,6 +95,6 @@ else
info
=
6
;
% Ok (nothing to do ;-)
if
nargout
>
1
description
=
'There is nothing to do'
;
end
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
matlab/get_name_of_the_last_mh_file.m
+
2
−
2
View file @
3cbdec01
...
...
@@ -33,7 +33,7 @@ info = 1;
MetropolisFolder
=
CheckPath
(
'metropolis'
,
M_
.
dname
);
ModelName
=
M_
.
fname
;
BaseName
=
[
MetropolisFolder
,
ModelName
];
BaseName
=
[
MetropolisFolder
filesep
ModelName
];
load_last_mh_history_file
(
MetropolisFolder
,
ModelName
);
...
...
@@ -44,7 +44,7 @@ predicted_mhname = [ BaseName '_mh' int2str(mh_number) '_blck' int2str(bk_number
all_mh_files
=
dir
([
BaseName
'_mh*_blck*'
]);
[
junk
,
idx
]
=
sort
([
all_mh_files
.
datenum
]);
mhnam
m
e
=
all_mh_files
(
idx
(
end
))
.
name
;
mhname
=
all_mh_files
(
idx
(
end
))
.
name
;
if
~
strcmpi
(
mhname
,
predicted_mhname
)
info
=
0
;
...
...
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