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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dóra Kocsis
dynare
Commits
55764e66
Commit
55764e66
authored
May 31, 2010
by
Marco Ratto
Browse files
Options
Downloads
Patches
Plain Diff
1) eliminated use of struct2local;
2) changes to header/comments.
parent
1021e43d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
matlab/prior_posterior_statistics.m
+12
-9
12 additions, 9 deletions
matlab/prior_posterior_statistics.m
matlab/prior_posterior_statistics_core.m
+45
-21
45 additions, 21 deletions
matlab/prior_posterior_statistics_core.m
with
57 additions
and
30 deletions
matlab/prior_posterior_statistics.m
+
12
−
9
View file @
55764e66
...
...
@@ -18,6 +18,10 @@ function prior_posterior_statistics(type,Y,gend,data_index,missing_value)
% SPECIAL REQUIREMENTS
% none
% PARALLEL CONTEXT
% See the comments random_walk_metropolis_hastings.m funtion.
% Copyright (C) 2005-2010 Dynare Team
%
% This file is part of Dynare.
...
...
@@ -142,7 +146,7 @@ end
% Store the variable mandatory for local/remote parallel computing.
localVars
.
type
e
=
type
;
localVars
.
type
=
type
;
localVars
.
run_smoother
=
run_smoother
;
localVars
.
gend
=
gend
;
localVars
.
Y
=
Y
;
...
...
@@ -158,6 +162,8 @@ localVars.iendo=iendo;
if
horizon
localVars
.
i_last_obs
=
i_last_obs
;
localVars
.
IdObs
=
IdObs
;
localVars
.
MAX_nforc1
=
MAX_nforc1
;
localVars
.
MAX_nforc2
=
MAX_nforc2
;
end
localVars
.
exo_nbr
=
exo_nbr
;
localVars
.
maxlag
=
maxlag
;
...
...
@@ -168,10 +174,6 @@ if naK
localVars
.
MAX_naK
=
MAX_naK
;
end
localVars
.
MAX_nruns
=
MAX_nruns
;
if
horizon
localVars
.
MAX_nforc1
=
MAX_nforc1
;
localVars
.
MAX_nforc2
=
MAX_nforc2
;
end
localVars
.
MAX_momentsno
=
MAX_momentsno
;
localVars
.
ifil
=
ifil
;
...
...
@@ -191,10 +193,10 @@ end
b
=
0
;
if
isnumeric
(
options_
.
parallel
),
% | isunix, % for the moment exclude unix platform from parallel implementation
% Like sequential execution!
if
isnumeric
(
options_
.
parallel
),
% | isunix, % For the moment exclude unix platform from parallel implementation!
[
fout
]
=
prior_posterior_statistics_core
(
localVars
,
1
,
B
,
0
);
% Parallel execution!
else
[
nCPU
,
totCPU
,
nBlockPerCPU
]
=
distributeJobs
(
options_
.
parallel
,
1
,
B
);
for
j
=
1
:
totCPU
-
1
,
...
...
@@ -252,7 +254,8 @@ save([DirectoryName '/' M_.fname '_data.mat'],'stock_gend','stock_data');
if
~
isnumeric
(
options_
.
parallel
),
leaveSlaveOpen
=
options_
.
parallel_info
.
leaveSlaveOpen
;
if
options_
.
parallel_info
.
leaveSlaveOpen
==
0
,
options_
.
parallel_info
.
leaveSlaveOpen
=
1
;
% force locally to leave open remote matlab sessions (repeated pm3 calls)
% Commenting for testing!
% options_.parallel_info.leaveSlaveOpen = 1; % Force locally to leave open remote matlab sessions (repeated pm3 calls)
end
end
...
...
This diff is collapsed.
Click to expand it.
matlab/prior_posterior_statistics_core.m
+
45
−
21
View file @
55764e66
function
myoutput
=
prior_posterior_statistics_core
(
myinputs
,
fpar
,
B
,
whoiam
,
ThisMatlab
)
% Copyright (C) 2005-2010 Dynare Team
% PARALLEL CONTEXT
% Core functionality for prior_posterior.m function, which can be parallelized.
% See also the comment in random_walk_metropolis_hastings_core.m funtion.
%
% INPUTS
% See See the comment in random_walk_metropolis_hastings_core.m funtion.
% OUTPUTS
% o myoutput [struc]
% Contained OutputFileName_smooth;
% _update;
% _inno;
% _error;
% _filter_step_ahead;
% _param;
% _forc_mean;
% _forc_point
%
% ALGORITHM
% Portion of prior_posterior.m function.
% This file is part of Dynare.
%
% SPECIAL REQUIREMENTS.
% None.
% Dynare is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
...
...
@@ -23,7 +42,14 @@ if nargin<4,
whoiam
=
0
;
end
typee
=
myinputs
.
typee
;
global
options_
oo_
M_
bayestopt_
estim_params_
% Reshape 'myinputs' for local computation.
% In order to avoid confusion in the name space, the instruction struct2local(myinputs) is replaced by:
% Da CONTROLLARE con MARCO!
type
=
myinputs
.
type
;
run_smoother
=
myinputs
.
run_smoother
;
gend
=
myinputs
.
gend
;
Y
=
myinputs
.
Y
;
...
...
@@ -39,27 +65,31 @@ iendo=myinputs.iendo;
if
horizon
i_last_obs
=
myinputs
.
i_last_obs
;
IdObs
=
myinputs
.
IdObs
;
MAX_nforc1
=
myinputs
.
MAX_nforc1
;
MAX_nforc2
=
myinputs
.
MAX_nforc2
;
end
if
naK
MAX_naK
=
myinputs
.
MAX_naK
;
end
exo_nbr
=
myinputs
.
exo_nbr
;
maxlag
=
myinputs
.
maxlag
;
MAX_nsmoo
=
myinputs
.
MAX_nsmoo
;
MAX_ninno
=
myinputs
.
MAX_ninno
;
MAX_nerro
=
myinputs
.
MAX_nerro
;
if
naK
MAX_naK
=
myinputs
.
MAX_naK
;
end
MAX_nruns
=
myinputs
.
MAX_nruns
;
if
horizon
MAX_nforc1
=
myinputs
.
MAX_nforc1
;
MAX_nforc2
=
myinputs
.
MAX_nforc2
;
end
MAX_momentsno
=
myinputs
.
MAX_momentsno
;
ifil
=
myinputs
.
ifil
;
if
~
strcmpi
(
type
e
,
'prior'
),
if
~
strcmpi
(
type
,
'prior'
),
x
=
myinputs
.
x
;
logpost
=
myinputs
.
logpost
;
end
if
whoiam
Parallel
=
myinputs
.
Parallel
;
MasterName
=
myinputs
.
MasterName
;
DyMo
=
myinputs
.
DyMo
;
end
DirectoryName
=
CheckPath
(
'metropolis'
);
...
...
@@ -97,12 +127,12 @@ end
for
b
=
fpar
:
B
% [deep, logpo] = GetOneDraw(type
e
);
% [deep, logpo] = GetOneDraw(type);
% set_all_parameters(deep);
% dr = resol(oo_.steady_state,0);
if
strcmpi
(
type
e
,
'prior'
)
if
strcmpi
(
type
,
'prior'
)
[
deep
,
logpo
]
=
GetOneDraw
(
type
e
);
[
deep
,
logpo
]
=
GetOneDraw
(
type
);
else
deep
=
x
(
b
,:);
...
...
@@ -171,12 +201,6 @@ for b=fpar:B
irun
=
irun
+
ones
(
7
,
1
);
%
% TempPath=DirectoryName;
% DirectoryNamePar='C:\dynare_calcs\ModelTest\ls2003\metropolis'
% DirectoryName=DirectoryNamePar;
if
irun
(
1
)
>
MAX_nsmoo
||
b
==
B
stock
=
stock_smooth
(:,:,
1
:
irun
(
1
)
-
1
);
...
...
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