JeremyGelb / spNetwork

An R package to perform spatial analysis on networks.
GNU General Public License v2.0
34 stars 2 forks source link

Questions about the adaptive bandwidth #14

Closed bright1993ff66 closed 1 year ago

bright1993ff66 commented 1 year ago

Thank you for contributing to spatial data science by creating and maintaining such a marvelous package!

I am working on a density estimation project, and the task is to compute the network densities of accidents across a road network. By following the Network KDE tutorial, I am able to compute the network KDE of point features on the roads.

But I still have one question about the calculation of adaptive bandwidth. Here, it seems like you calculate the bandwidth for each event (in my case, accident):

Computing the Adaptive Bandwidth

But how the bandwidth for the sample points are actually calculated? You mentioned that The densities at sampling points are then evaluated by using the obtained vector of bandwidth for each event, which is not quite clear. Can you give a more detailed description of this? Thank you very much for your time!

JeremyGelb commented 1 year ago

Hello there !

The sentence is indeed not very clear. In spNetwork, to reduce the computation time, the adaptive bandwidths are calculated only at the events' locations. Then, they are used to "spread the weight" of the events around them. Each sampling point within this bandwidth will receive a part of its weight.

Here is another explanation from the article in the Rjournal : """ Second, the calculus of the density is event-oriented. In other words, the kernel density is sequentially calculated around each event. The density values of the samples are updated at each iteration. The advantage of this approach is that the calculation time is less affected by the density of the sampling points. """

bright1993ff66 commented 1 year ago

@JeremyGelb Thank you for your feedback! It makes more sense to me now 😃

JeremyGelb commented 1 year ago

Perfect! I close the issue. Feel free to open a new one if you have another question.