Skip to content

How to fit a line through the "Mountain crest", i.e., through the highest density of points - in a "loess-like" fashion.

3 messages · Emmanuel Levy, David Winsemius

#
On Mar 10, 2012, at 3:55 PM, Emmanuel Levy wrote:

            
Are you familiar with the kde2d  of bkde2D functions in various  
packages? If you then collected the max density for each X and Y you  
might want to see whether that 2-d function would follow a  
sufficiently regular path that would represent the projection of the  
ridge on the z=0 plane.
Do you want a curve or a line?
I don't. I happen to have a dataset where I could test it. But you are  
likely to get better responses if you provide a test case.
Plain text is preferred.
#
Hi,

Thanks a lot for your reply - I posted a second message where I
provide a "dummy" example, entitled
"How to improve the robustness of "loess"? - example included".

I need to fit a curve which makes it a bit difficult to work with kde2d only.

I'm actually trying to use kde2d in combination with loess - basically
I give the output density of kde2d as weights in the "loess" function.
It seems to give nice results :)

In my second post I wrote that the "weight" option did not work but
that's because I was writing "weigth" - not sure why I did not get an
error message.

I'll post the lines of code as a reply to the second post.

All the best,

Emmanuel
On 10 March 2012 19:46, David Winsemius <dwinsemius at comcast.net> wrote: