Closed weikang9009 closed 4 years ago
I think the equation is implemented incorrectly.. It should read:
support, kestimate = _k(pp, intervals, dmin, dmax, d).T
lestimate = np.sqrt(kestimate / np.pi)
return np.column_stack((support, lestimate))
FWIW, this is the formulation found in O’Sullivan and Unwin (2010). I was going to add it into spaghetti
before realizing it is not well-suited for networks.
I think the equation is implemented incorrectly.. It should read:
support, kestimate = _k(pp, intervals, dmin, dmax, d).T lestimate = np.sqrt(kestimate / np.pi) return np.column_stack((support, lestimate))
I do not see a major difference between these two implementations - the only difference is that your implementation does not deduct the distance from the "normalized" L function. The current implementation in pointpats
follows another routine (as pointed out by @jGaboardi ) and is also shown in the Wikipedia:
I think the main purpose is to make the interpretation more intuitive: under the null, the L function follows a horizontal line at 0.
We have found the bug and Serge has fixed it in https://github.com/pysal/pointpats/pull/45. Another bug is introduced with this PR and it is supposed to be fixed in https://github.com/pysal/pointpats/pull/46. I should have closed this issue (have been waiting for the close of the https://github.com/pysal/pointpats/pull/46) - sorry if this induces any confusion.
I see! Feel free to close this then!
the only difference...
Right. The plotting correction is not the L function itself.
I understand the L with this adjustment is interpreted like the J but centered on zero.
I think this needs to be documented + given an option.
The equation is given in the example notebook for distance statistics. I will add the missing equations for the distance functions to the inline docstrings. Thanks for the suggestion.
This issue is raised by a user of
pointpats
- Wei Xie.The Simulation Envelope under the null of CSR built for the L function is nowhere near 0 (see the following figure), which is not right based on its definition.![image](https://user-images.githubusercontent.com/7359284/70667138-061aaa80-1c25-11ea-9b81-af59a80165c0.png)