Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dóra Kocsis
dynare
Commits
e8f159f6
Commit
e8f159f6
authored
Aug 30, 2012
by
MichelJuillard
Browse files
fixing bugs in previous commit
parent
1bac2d34
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/independent_metropolis_hastings_core.m
View file @
e8f159f6
...
...
@@ -105,13 +105,19 @@ for b = fblck:nblck,
% this will not work if the master uses a random generator not
% available in the slave (different Matlab version or
% Matlab/Octave cluster). Therefor the trap.
set_dynare_seed
(
options_
.
DynareRandomStreams
.
algo
);
% this set the random generator type (the seed is useless but
% needed by the function)
set_dynare_seed
(
options_
.
DynareRandomStreams
.
algo
,
...
options_
.
DynareRandomStreams
.
seed
);
% this set the state
set_dynare_random_generator_state
(
record
.
Seeds
(
b
)
.
Unifor
,
...
record
.
Seeds
(
b
)
.
Normal
);
catch
% if the state set by master is incompatible with the slave, we
% only reseed
set_dynare_seed
(
options_
.
DynareRandomStreams
.
seed
+
b
);
end
set_dynare_random_generator_state
(
record
.
Seeds
(
b
)
.
Unifor
,
record
.
Seeds
(
b
)
.
Normal
);
if
(
options_
.
load_mh_file
~=
0
)
&&
(
fline
(
b
)
>
1
)
&&
OpenOldFile
(
b
)
load
([
'./'
MhDirectoryName
'/'
ModelName
'_mh'
int2str
(
NewFile
(
b
))
...
'_blck'
int2str
(
b
)
'.mat'
])
...
...
matlab/random_walk_metropolis_hastings_core.m
View file @
e8f159f6
...
...
@@ -139,10 +139,17 @@ for b = fblck:nblck,
% this will not work if the master uses a random generator not
% available in the slave (different Matlab version or
% Matlab/Octave cluster). Therefor the trap.
set_dynare_seed
(
options_
.
DynareRandomStreams
.
algo
);
% this set the random generator type (the seed is useless but
% needed by the function)
set_dynare_seed
(
options_
.
DynareRandomStreams
.
algo
,
...
options_
.
DynareRandomStreams
.
seed
);
% this set the state
set_dynare_random_generator_state
(
record
.
Seeds
(
b
)
.
Unifor
,
...
record
.
Seeds
(
b
)
.
Normal
);
catch
% if the state set by master is incompatible with the slave, we
% only reseed
set_dynare_seed
(
options_
.
DynareRandomStreams
.
seed
+
b
);
end
if
(
options_
.
load_mh_file
~=
0
)
&&
(
fline
(
b
)
>
1
)
&&
OpenOldFile
(
b
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment