Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about rejection #9

Open
Peku995 opened this issue Jun 22, 2023 · 2 comments
Open

Question about rejection #9

Peku995 opened this issue Jun 22, 2023 · 2 comments

Comments

@Peku995
Copy link

Peku995 commented Jun 22, 2023

Hello, I have a question concering the rejection criterium. In the case of non-parallel, in line 213, namely
if logrand(1,wix)<(numel(proposedm(:,wix))-1)*log(zz(wix))
and line 216, namely
if logrand(fix+1,wix)>proposedlogP(fix)-curlogP(fix,wix) || ~isreal(proposedlogP(fix)) || isnan(proposedlogP(fix))

how did you come up with these lines? I could not find them in the original publication.
This would help me a lot.

@grinsted
Copy link
Owner

I have pretty much moved away from matlab, so it has been a while since i looked at it. So this answer comes without looking at the code or the paper - here what i think i must have been doing:

  1. You can cascade acceptance/rejection criteria (the looping of if's). The gist of the idea is in the "modification of random walks" section of this paper: https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/94JB03097
  2. using logarithms on both sides of the inequality.
  3. treat the probability as 0 outside the support of the function (hence the isreal and isnan)

I hope this helps.

@Peku995
Copy link
Author

Peku995 commented Jun 23, 2023

thank you very much for the quick answer!
i have one more question, which i hope is not too obvious.
If I understand correctly, the Goodman and Weare algorithm is used to determine random new points, and the criterion for determining whether the new points are accepted or not is based on the the paper you mentioned above, is that correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants