Skip to content
Snippets Groups Projects
Commit 560d9719 authored by Johannes Pfeifer's avatar Johannes Pfeifer
Browse files

Correct copy and paste mistake in prior_draw.m for inverse gamma II

In case of bound violations, it was instead sampled from inverse gamma I
parent 3d9f12d7
No related branches found
No related tags found
No related merge requests found
...@@ -139,7 +139,7 @@ if inverse_gamma_2_draws ...@@ -139,7 +139,7 @@ if inverse_gamma_2_draws
out_of_bound = find( (pdraw(inverse_gamma_2_index)'>ub(inverse_gamma_2_index)) | (pdraw(inverse_gamma_2_index)'<lb(inverse_gamma_2_index))); out_of_bound = find( (pdraw(inverse_gamma_2_index)'>ub(inverse_gamma_2_index)) | (pdraw(inverse_gamma_2_index)'<lb(inverse_gamma_2_index)));
while ~isempty(out_of_bound), while ~isempty(out_of_bound),
pdraw(inverse_gamma_2_index(out_of_bound)) = ... pdraw(inverse_gamma_2_index(out_of_bound)) = ...
sqrt(1./gamrnd(p7(inverse_gamma_2_index(out_of_bound))/2,2./p6(inverse_gamma_2_index(out_of_bound))))+p3(inverse_gamma_2_index(out_of_bound)); 1./gamrnd(p7(inverse_gamma_2_index(out_of_bound))/2,2./p6(inverse_gamma_2_index(out_of_bound)))+p3(inverse_gamma_2_index(out_of_bound));
out_of_bound = find( (pdraw(inverse_gamma_2_index)'>ub(inverse_gamma_2_index)) | (pdraw(inverse_gamma_2_index)'<lb(inverse_gamma_2_index))); out_of_bound = find( (pdraw(inverse_gamma_2_index)'>ub(inverse_gamma_2_index)) | (pdraw(inverse_gamma_2_index)'<lb(inverse_gamma_2_index)));
end end
end end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment