Re: [R] Smoothing z-values according to their x, y positions

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Thu, 20 Mar 2008 13:15:49 +0000 (UTC)

"Emmanuel Levy" <emmanuel.levy_at_gmail.com> wrote in news:e4654710803191929j554c211bla7088bc8bc69c445_at_mail.gmail.com:

> Dear David,
>
> Thanks a lot for pointing out kde2d, just tried it out but the
> problem is that it indeed takes the density of points into account,
> which I dont want.
>
> For example, if in an region of surface S I've got 10,000 points,
> and that their average height is 0.5, and in an other region I've
> got only ten points and their average value if also 0.5, I'd like
> all these points to be transformed to the same
> 0.5 value. At the moment, it seems that it's not the case.
>
> For example, the range of the values I give is: 0.2 - 3.7, but the
> range of the values
> that are outputed is 0 - 0.17.

>> "Emmanuel Levy" <emmanuel.levy_at_gmail.com> wrote in
>>  news:e4654710803191554k4dfc2728g70bde35f41627754_at_mail.gmail.com:
>>
>>
>>  > Dear Bert,
>>  >
>>  > Thanks for your reply - I indeed saw a lot of functions using: 
>>  > help.search("smooth") 
>>  >
>>  > The problem is that most seem to not be very appropriate to what 
>>  > I'd like, or they seem extremely complicated (e.g. gma). I am 
>>  > probably missing something as I don't see how to use Loess. From
>>  > my poor understanding, it seems to be for 2D data. Here I want
>>  > to smooth the third "z" component. 

Your description of what is desired leads me to believe you were misreading the "loess" documentation. For proof I suggest you visit Deepayan Sarkar's webpage and in particular see Figure 6.8 where 3d plots of loess fits for more complex data arrangements are exemplified:
Choose Figure 6.8 (code on right side of window): <http://lmdvr.r-forge.r-project.org/figures/figures.html>

Code:
<http://dsarkar.fhcrc.org/lattice/book/Chapter06-Trivariate/all.R>

PNG image:
<http://dsarkar.fhcrc.org/lattice/book/images/Figure_06_08_stdClassic.png>

-- 
David Winsemius

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 20 Mar 2008 - 13:19:25 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 20 Mar 2008 - 14:00:23 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive