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
b1ad31cf
Commit
b1ad31cf
authored
Aug 05, 2012
by
MichelJuillard
Browse files
removed seeding random generators from clock in cmaes and metropolis hastings
parent
6b3bd9dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
matlab/cmaes.m
View file @
b1ad31cf
...
@@ -644,11 +644,11 @@ else % flgresume
...
@@ -644,11 +644,11 @@ else % flgresume
end
end
% initialize random number generator
% initialize random number generator
if
ischar
(
opts
.
Seed
)
% $$$
if ischar(opts.Seed)
randn
(
'state'
,
eval
(
opts
.
Seed
));
% random number generator state
% $$$
randn('state', eval(opts.Seed)); % random number generator state
else
% $$$
else
randn
(
'state'
,
opts
.
Seed
);
% $$$
randn('state', opts.Seed);
end
% $$$
end
%qqq
%qqq
% load(opts.SaveFilename, 'startseed');
% load(opts.SaveFilename, 'startseed');
% randn('state', startseed);
% randn('state', startseed);
...
...
matlab/metropolis_hastings_initialization.m
View file @
b1ad31cf
...
@@ -180,9 +180,6 @@ if ~options_.load_mh_file && ~options_.mh_recover
...
@@ -180,9 +180,6 @@ if ~options_.load_mh_file && ~options_.mh_recover
% separate initializaton for each chain
% separate initializaton for each chain
JSUM
=
0
;
JSUM
=
0
;
for
j
=
1
:
nblck
,
for
j
=
1
:
nblck
,
JSUM
=
JSUM
+
sum
(
100
*
clock
);
randn
(
'state'
,
JSUM
);
rand
(
'state'
,
JSUM
);
record
.
Seeds
(
j
)
.
Normal
=
randn
(
'state'
);
record
.
Seeds
(
j
)
.
Normal
=
randn
(
'state'
);
record
.
Seeds
(
j
)
.
Unifor
=
rand
(
'state'
);
record
.
Seeds
(
j
)
.
Unifor
=
rand
(
'state'
);
end
end
...
...
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