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

Algorithm AS 176 for KDE's #29

Merged
merged 11 commits into from
Apr 7, 2013
Merged

Algorithm AS 176 for KDE's #29

merged 11 commits into from
Apr 7, 2013

Conversation

johnmyleswhite
Copy link
Member

Here's the start of an alternative KDE implementation:

using Distributions
x, smooth = kde([1., 1., 1., 2.], 512)

This code needs to get cleaned up, but it should provide a faster way to compute KDE's with Gaussian kernels than the more general purpose code currently being discussed.

There are two major bugs right now:

  • Results do not integrate to 1
  • There are odd interlacing effects in the results

I'll try to finish this over the next few days, but wanted to get the draft code out there for comparison with Jameson's approach -- which will probably be complete much sooner than this code will be.

@johnmyleswhite
Copy link
Member Author

I've fixed the scaling problem, which was caused by an inaccurate calculation of the original histogram that gets convolved with the kernel. Still working on the interlacing problem.

@johnmyleswhite
Copy link
Member Author

It would be great if someone with more familiarity with FFT's got a chance to look at this. I suspect I've made a simple mistake.

@simonbyrne simonbyrne mentioned this pull request Mar 19, 2013
@johnmyleswhite
Copy link
Member Author

This looks like it basically works now thanks to @simonbyrne's patch. I think the actual bandwidth being used is more extreme than R's, though, which leads to some oversmoothing.

johnmyleswhite added a commit that referenced this pull request Apr 7, 2013
Algorithm AS 176 for KDE's
@johnmyleswhite johnmyleswhite merged commit 392ed42 into master Apr 7, 2013
@johnmyleswhite johnmyleswhite deleted the kde branch April 7, 2013 16:43
@montyvesselinov montyvesselinov mentioned this pull request Apr 16, 2017
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.

3 participants