[R-sig-Geo] time-weighted kernel density interpolation
stepen.condors at gmail.com
stepen.condors at gmail.com
Tue Mar 22 06:05:41 CET 2011
Thanks for this Michael - I am investigating the trip library as we speak.
Another (potentially stupid) query:
I have a point pattern (as a ppp):
test.ppp = ppp(test.eastings, test.northings, xrange=c(1000000, 2000000), yrange=c(1000000,2000000))
I'd like to generate a grid over this area storing an associated intensity score with each grid cell - so that where points intersect that grid I can add some value to the intensity score of the cell they lie in (and surrounding ones ideally).
What grid method would you recommend? and then how might you go about calculating the intersection of points and polygons?
Many Thanks
Stepen
On 21/03/2011, at 6:46 AM, Michael Sumner wrote:
> Hi Stepen,
>
> The function tripGrid in package trip does something similar to this
> for the time interval between points ("time spent in area") - by using
> spatstat's density function on the line segments. The KDE approach is
> there for exploration though I think the straight grid approach is
> usually better (neither method has any systematic handling for
> location error).
>
> I've long meant to generalize the tripGrid function so that it's not
> so tied to the time interval and the user could specify the
> "weighting" - but that always brings up the issue of whether is is the
> points or the implicit line segments between them that are of
> interest.
>
> The density.ppp function in spatstat could be used to do this, though
> I wonder what kind of result you are expecting from this method?
>
> Some of the approaches in adehabitat (and its new family of packages)
> could be useful too.
>
> Cheers, Mike.
>
>
>
> On Mon, Mar 21, 2011 at 3:05 AM, <stepen.condors at gmail.com> wrote:
>> Hi all
>> I am currently looking into developing some sort of time-weighted kernel density interpolation in R. It is my aim to build something which allows me to the the following:
>>
>> - Import a point pattern p with associated times for each event
>> - Plot a time weighted kernel density map of p - such that more recent events have a greater weighting than those that occurred earlier.
>> - Ideally it would be useful to specify both the spatial and temporal bandwidths and the decay function types i.e. linear, exponential
>> - Import new point data and assign an intensity score to each point from its location on time-weighted kernel density surface.
>>
>> Is this something that is relatively easily doable in R or am I crazy?
>> I have developed something similar previously in both C++ and VB.NET (cough) interfacing directly with MapInfo so I am not afraid of code.
>> However, as I am still relatively new to R I imagined that there were likely some better and worse ways to do this and/or libraries to look at. I have checked out the sp and spatstat libraries - but neither seem to have much to do with time, next i am considering trip. Where would you start? I would hate to waste time implementing something just because I was unaware of an existing solution.
>>
>> Therefore any advice, suggestions, experiences or abuse concerning how I might accomplish this functionality would be greatly appreciated.
>>
>> Best
>> Stepen
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
>
>
> --
> Michael Sumner
> Institute for Marine and Antarctic Studies, University of Tasmania
> Hobart, Australia
> e-mail: mdsumner at gmail.com
More information about the R-sig-Geo
mailing list