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

Sampling Uniform_11OrthoPoly #84

Open
urp1 opened this issue Sep 20, 2022 · 1 comment
Open

Sampling Uniform_11OrthoPoly #84

urp1 opened this issue Sep 20, 2022 · 1 comment

Comments

@urp1
Copy link

urp1 commented Sep 20, 2022

I am getting many warnings with the following message and Julia freezes indefinitely:

┌ Warning: ignoring keyword method; sampling from Distributions.jl instead
└ @ PolyChaos JULIA_DIR\PolyChaos\THVqe\src\polynomial_chaos.jl:208`

when executing the last command in the following code:

N = 100;
x = sampleMeasure(N, Uniform01OrthoPoly(5));
y = sampleMeasure(N, Uniform_11OrthoPoly(5))

Any ideas on what may be causing errors when sampling Uniform_11OrthoPoly but not when sampling Uniform01OrthoPoly?

Thanks

@timueh
Copy link
Collaborator

timueh commented Sep 29, 2022

Hi @urp1,

I'm sorry you're experiencing this kind of inconvenience.

tl; dr: currently, Uniform_11OrthoPoly is using a different sampling function than Uniform01OrthoPoly. This should be undone, and then solve your problem.

Off the top of my head, I am not sure what's causing this. Here are my thoughts though:

When sampling Uniform010OrthoPoly(5) you are essentially using Distributions.jl to sample, see the code here.

When you're sampling for Uniform_11Orthopoly, you are not using Distributions.jl, but you're probably ending up here.

Now, the following would be nice (and solve your issues): sampling from the uniform distributions on [-1, 1] is essentially the same as sampling from the canonical uniform distribution defined on [0, 1]. Hence, it would be nice to use the same sampling function for [-1, 1] as for [0, 1] (the one from Distributions.jl). Of course, there would have to be a straightforward translation step necessary..

Does this make sense to you?

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