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

Reflective boundaries implementation #18

Open
myradio opened this issue Aug 20, 2023 · 4 comments
Open

Reflective boundaries implementation #18

myradio opened this issue Aug 20, 2023 · 4 comments

Comments

@myradio
Copy link

myradio commented Aug 20, 2023

From the JOSS,

Reflecting boundary conditions can be used to improve reconstruction accuracy. For example, with data drawn from a log-normal distribution, a standard KDE will produce ‘leakage’ outside of the domain. To enforce the restriction that f(x < 0) = 0 (which must be known {a priori}), the kernel is redefined such that KH(x < 0) = 0, and re-normalized to preserve unitarity1 . This example is shown in Figure 1, with histograms in the upper panel and KDEs on the bottom.

Isn't this then absorbing boundary conditions? Or am I missing something?

@syrte
Copy link

syrte commented Aug 21, 2023

Not sure if this is what you are asking: https://kalepy.readthedocs.io/en/latest/kde_api.html#reflecting-boundaries

@myradio
Copy link
Author

myradio commented Aug 21, 2023

Your link shows an example of how to use this feature in kalepy package.
My question regards what is doing under the hood when we use the option 'reflect=True', but I reckon I will have to dig myself. From what I read on the JOSS paper that explains what the package does, my first thinking is that what here is called reflective BC is actually absorbing BC.

@lzkelley
Copy link
Owner

lzkelley commented Aug 23, 2023

Hi @myradio , I think you're right that the description in the paper is actually describing absorption. I'm not sure how/why this got mixed up in the paper - but thank you for pointing it out. The implementation however is actually that of reflection, which you can see here.

Does that clarify things?

@myradio
Copy link
Author

myradio commented Sep 27, 2023

Hi @lzkelley , Sorry for the delay. You are absolutely right!. Actually it is both things, right? After reflecting the data wrt the boundary as (the code you mentioned) , then you need to set to zero the pdf beyond the boundary. Thanks!

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

3 participants