Menu

#501 2D kernel density estimate with dgrid3d

closed-accepted
nobody
None
5
2010-11-06
2010-10-08
No

I was trying to plot a kernel density estimate for a 2D dataset. This is possible for 1D data (with 'smooth kdensity'), but not for 2D data.

While trying to do it with external tools, I realized that the existing 'dgrid3d' functionality already has every ingredient, and in fact does exactly what I need with a small modification. (dgrid3d uses the following formula to calculate the new grid values: z = Sum_i w(d_i) * z_i / Sum_i w(d_i). If I set all z_i to a constant, and omit the division, I get a KDE.)

This patch implements a new option to 'set dgrid3d': 'kdensity2d'. If given, it modifies the algorithm so that the division mentioned above does not take place.

Documentation and new demo included.

Discussion

  • Ethan Merritt

    Ethan Merritt - 2010-10-09

    Looks good to me. Perhaps another sentence or two in the docs that defines or explains "kernel density"? I had to look it up separately.

     
  • Péter Juhász

    Péter Juhász - 2010-10-09

    Re-uploaded with slightly more documentation.
    Feel free to reword it if it seems too un-English.

     
  • Ethan Merritt

    Ethan Merritt - 2010-10-10

    Looks OK, except there is a missing word:
    "this smooth [surface] is plotted instead of the original data"

    It still remains to add the option to save.c and show.c

     
  • Péter Juhász

    Péter Juhász - 2010-10-10

    2D kernel density estimate with dgrid3d - v3

     
  • Péter Juhász

    Péter Juhász - 2010-10-10

    I've totally forgot about those, but it's fixed now.

     
  • Ethan Merritt

    Ethan Merritt - 2010-11-06

    Are you going to go ahead and add this to CVS?

     
  • Péter Juhász

    Péter Juhász - 2010-11-06

    Thanks for the reminder, I've checked it it now.

     
  • Péter Juhász

    Péter Juhász - 2010-11-06
    • status: open --> closed-accepted
     
  • Nobody/Anonymous

    WZe7PA <a href="http://psnzghkjbqin.com/">psnzghkjbqin</a>, [url=http://hpspyawzyksh.com/]hpspyawzyksh[/url], [link=http://qreqknnbjqjo.com/]qreqknnbjqjo[/link], http://tjoearljdiuo.com/

     
  • Douglas

    Douglas - 2011-06-15

    I could really use this feature. Is it in the CVS version? (And therefore, do I need to check it out) or has it been integrated into any official version?

     
  • Péter Juhász

    Péter Juhász - 2011-06-15

    It's in the CVS, but not in any released version.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.