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
243006b2
Commit
243006b2
authored
Sep 15, 2010
by
JUILLARD Michel
Browse files
metropolis: factorizing computation of covariance of proposal
parent
f6aace08
Changes
1
Hide whitespace changes
Inline
Side-by-side
matlab/random_walk_metropolis_hastings_core.m
View file @
243006b2
...
...
@@ -118,7 +118,8 @@ end
%%%%
%%%% NOW i run the (nblck-fblck+1) metropolis-hastings chains
%%%%
jscale
=
diag
(
bayestopt_
.
jscale
);
proposal_covariance
=
d
*
diag
(
bayestopt_
.
jscale
);
jloop
=
0
;
...
...
@@ -159,7 +160,7 @@ for b = fblck:nblck,
irun
=
fline
(
b
);
j
=
1
;
while
j
<=
nruns
(
b
)
par
=
feval
(
ProposalFun
,
ix2
(
b
,:),
d
*
jscal
e
,
n
);
par
=
feval
(
ProposalFun
,
ix2
(
b
,:),
proposal_covarianc
e
,
n
);
if
all
(
par
(:)
>
mh_bounds
(:,
1
)
)
&
all
(
par
(:)
<
mh_bounds
(:,
2
)
)
try
logpost
=
-
feval
(
TargetFun
,
par
(:),
varargin
{:});
...
...
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