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 on unweighted Gauss-Hermite #102

Open
karenml opened this issue Jul 30, 2021 · 1 comment
Open

Question on unweighted Gauss-Hermite #102

karenml opened this issue Jul 30, 2021 · 1 comment

Comments

@karenml
Copy link

karenml commented Jul 30, 2021

This might be obvious, but why do you do
_w .*= sqrt(π)/sum(exp.(-_x.^2).*_w)

(in line 54) to the unweighted Gauss-Hermite quadrature weights?

Thanks!

@dlfivefifty
Copy link
Member

exp.(-_x.^2).*_w gives the Gauss quadrature weights so sum(exp.(-_x.^2).*_w) will give what they think is the integral of 1 * exp(-x^2). We know this should be sqrt(π) so this line fixes any issue with getting the scaling wrong.

Note this was present in @ajt60gaibb original implementation:

bfd8eac#diff-28a0f2d6660b3d3cf920bd063823ccfcd0d64bf99303eb221485646ac5fe881aR27

So maybe he knows why this fix is needed?

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