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
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
Stéphane Adjemian
dynare
Commits
d44ca729
Commit
d44ca729
authored
Jun 22, 2012
by
Sébastien Villemot
Browse files
Options
Downloads
Plain Diff
Merge remote-tracking branch 'ratto/master'
parents
a6648b59
cb2526ba
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
matlab/PosteriorIRF_core1.m
+13
-13
13 additions, 13 deletions
matlab/PosteriorIRF_core1.m
with
13 additions
and
13 deletions
matlab/PosteriorIRF_core1.m
+
13
−
13
View file @
d44ca729
function
myoutput
=
PosteriorIRF_core1
(
myinputs
,
fpar
,
npar
,
whoiam
,
ThisMatlab
)
function
myoutput
=
PosteriorIRF_core1
(
myinputs
,
fpar
,
B
,
whoiam
,
ThisMatlab
)
% PARALLEL CONTEXT
% PARALLEL CONTEXT
% This function perfom in parallel a portion of PosteriorIRF.m code.
% This function perfom in parallel a portion of PosteriorIRF.m code.
% This is a special kind of parallel function. Unlike of other parallel functions,
% This is a special kind of parallel function. Unlike of other parallel functions,
...
@@ -134,7 +134,7 @@ end
...
@@ -134,7 +134,7 @@ end
% Parallel 'while' very good!!!
% Parallel 'while' very good!!!
stock_param
=
zeros
(
MAX_nruns
,
npar
);
stock_param
=
zeros
(
MAX_nruns
,
npar
);
stock_irf_dsge
=
zeros
(
options_
.
irf
,
nvar
,
M_
.
exo_nbr
,
MAX_nirfs_dsge
);
stock_irf_dsge
=
zeros
(
options_
.
irf
,
nvar
,
M_
.
exo_nbr
,
MAX_nirfs_dsge
);
while
fpar
<
npar
while
fpar
<
B
fpar
=
fpar
+
1
;
fpar
=
fpar
+
1
;
irun
=
irun
+
1
;
irun
=
irun
+
1
;
irun2
=
irun2
+
1
;
irun2
=
irun2
+
1
;
...
@@ -240,10 +240,10 @@ while fpar<npar
...
@@ -240,10 +240,10 @@ while fpar<npar
stock_irf_dsgevar
=
zeros
(
options_
.
irf
,
dataset_
.
info
.
nvobs
,
M_
.
exo_nbr
,
MAX_nirfs_dsgevar
);
stock_irf_dsgevar
=
zeros
(
options_
.
irf
,
dataset_
.
info
.
nvobs
,
M_
.
exo_nbr
,
MAX_nirfs_dsgevar
);
end
end
end
end
if
irun
==
MAX_nirfs_dsge
||
irun
==
npar
||
fpar
==
npar
if
irun
==
MAX_nirfs_dsge
||
irun
==
B
||
fpar
==
B
if
fpar
==
npar
if
fpar
==
B
stock_irf_dsge
=
stock_irf_dsge
(:,:,:,
1
:
irun
);
stock_irf_dsge
=
stock_irf_dsge
(:,:,:,
1
:
irun
);
if
MAX_nirfs_dsgevar
&&
(
fpar
==
npar
||
IRUN
==
npar
)
if
MAX_nirfs_dsgevar
&&
(
fpar
==
B
||
IRUN
==
B
)
stock_irf_bvardsge
=
stock_irf_bvardsge
(:,:,:,
1
:
IRUN
);
stock_irf_bvardsge
=
stock_irf_bvardsge
(:,:,:,
1
:
IRUN
);
instr
=
[
MhDirectoryName
'/'
M_
.
fname
'_irf_bvardsge'
...
instr
=
[
MhDirectoryName
'/'
M_
.
fname
'_irf_bvardsge'
...
int2str
(
NumberOfIRFfiles_dsgevar
)
'.mat stock_irf_bvardsge;'
];
int2str
(
NumberOfIRFfiles_dsgevar
)
'.mat stock_irf_bvardsge;'
];
...
@@ -262,8 +262,8 @@ while fpar<npar
...
@@ -262,8 +262,8 @@ while fpar<npar
NumberOfIRFfiles_dsge
=
NumberOfIRFfiles_dsge
+
1
;
NumberOfIRFfiles_dsge
=
NumberOfIRFfiles_dsge
+
1
;
irun
=
0
;
irun
=
0
;
end
end
if
irun2
==
MAX_nruns
||
fpar
==
npar
if
irun2
==
MAX_nruns
||
fpar
==
B
if
fpar
==
npar
if
fpar
==
B
stock_param
=
stock_param
(
1
:
irun2
,:);
stock_param
=
stock_param
(
1
:
irun2
,:);
end
end
stock
=
stock_param
;
stock
=
stock_param
;
...
@@ -276,26 +276,26 @@ while fpar<npar
...
@@ -276,26 +276,26 @@ while fpar<npar
end
end
% if exist('OCTAVE_VERSION'),
% if exist('OCTAVE_VERSION'),
% if (whoiam==0),
% if (whoiam==0),
% printf(['Posterior IRF %3.f%% done\r'],(fpar/
npar
*100));
% printf(['Posterior IRF %3.f%% done\r'],(fpar/
B
*100));
% end
% end
% elseif ~whoiam,
% elseif ~whoiam,
% waitbar(fpar/
npar
,h);
% waitbar(fpar/
B
,h);
% end
% end
% if whoiam,
% if whoiam,
% if ~exist('OCTAVE_VERSION')
% if ~exist('OCTAVE_VERSION')
% fprintf('Done! \n');
% fprintf('Done! \n');
% end
% end
% waitbarString = [ 'Subdraw ' int2str(fpar) '/' int2str(
npar
) ' done.'];
% waitbarString = [ 'Subdraw ' int2str(fpar) '/' int2str(
B
) ' done.'];
% fMessageStatus((fpar-fpar0)/(
npar
-fpar0),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
% fMessageStatus((fpar-fpar0)/(
B
-fpar0),whoiam,waitbarString, waitbarTitle, Parallel(ThisMatlab));
% end
% end
dyn_waitbar
((
fpar
-
fpar0
)/(
npar
-
fpar0
),
h
);
dyn_waitbar
((
fpar
-
fpar0
)/(
B
-
fpar0
),
h
);
end
end
dyn_waitbar_close
(
h
);
dyn_waitbar_close
(
h
);
if
whoiam
==
0
if
whoiam
==
0
if
nosaddle
if
nosaddle
disp
([
'PosteriorIRF :: Percentage of discarded posterior draws = '
num2str
(
nosaddle
/(
npar
+
nosaddle
))])
disp
([
'PosteriorIRF :: Percentage of discarded posterior draws = '
num2str
(
nosaddle
/(
B
+
nosaddle
))])
end
end
end
end
...
...
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