stpp-GitHub-community / stpp

Space-Time Point Pattern Simulation, Visualisation and Analysis
11 stars 5 forks source link

Coincident space-time points: code error & methodological point #7

Closed t-pollington closed 5 years ago

t-pollington commented 5 years ago

I am very glad you started this package, thank you @edit318 et al! I stumbled upon some findings when tinkering.

Code error: using the first entry of duplicated(), i.e. duplicated(...)[1] will only capture duplicated points when one of the n-plicates is across xyt[1,]. Using any() solves this.

Methodological: Although it is space-time coincidence which breaks STIKhat()(cf Gabriel & Diggle 2009), it would be useful to warn of the weaker version of space-time points being spatially coincident. This is of relevance for users computing the spatial intensity in other packages for mhat in the lambda = ... argument of your function. Furthermore as your STIKhat.Rd example uses Berman & Diggle's method to find the bandwidth (splancs::kernel2d), it is likely a novice (like myself) will follow suit (as I did) and get an incorrect bandwidth h back from that third-party function to use in yours---I had problems with spatially-coincident data with kernel2d() which causes the MSE(h) profile to lose its convex shape, leading to a minimal h that matches the smallest h-step (making the h step smaller just makes the minimal h reduce too, so h tends to zero).

frajaroco commented 5 years ago

Hi Tim,

Thanks for your suggestion about the code, I have implement this change in the GitHub repository. We will reply you methodological question as soon as possible.

Best!