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

Update de_snooker.py #531

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update de_snooker.py #531

wants to merge 1 commit into from

Conversation

yhwang17
Copy link

Fix Unit Vector Calculation and Adjust Metropolis Calculation in get_proposal

  • The vector delta was normalized using u = delta / np.sqrt(norm(delta)).

    • This approach is mathematically incorrect because dividing by sqrt(norm(delta)) does not produce a unit vector (a vector with magnitude 1).
    • As a result, the vector u had an incorrect magnitude, which could lead to:
      • Misaligned scaling in the generated proposals (q).
      • Errors in the Metropolis acceptance ratio due to incorrect distance calculations.
  • Fix:

    • The calculation has been corrected to divide delta by norm(delta), ensuring it is a unit vector as intended.
    • The Metropolis acceptance criterion scaling factor was adjusted from 0.5 * (ndim - 1.0) to ndim - 1.0 accordingly.

Refactor get_proposal function regrading the norm calculation.
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

Successfully merging this pull request may close these issues.

1 participant