Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jenv binsize correction is incorrect. #51

Closed
ljwolf opened this issue Apr 21, 2020 · 1 comment
Closed

Jenv binsize correction is incorrect. #51

ljwolf opened this issue Apr 21, 2020 · 1 comment
Labels

Comments

@ljwolf
Copy link
Member

ljwolf commented Apr 21, 2020

Using the book tokyo data for user 95795770@N00, I can get envelopes for G and F, but not J. I think this means whatever shape fix used here is wrong.

import pandas, pointpats
df = pandas.read_csv('https://raw.githubusercontent.com/gdsbook/book/master/'
                     'data/tokyo/tokyo_clean.csv')
coordinates = df.query('user_id == "95795770@N00"')[['x','y']].values
pattern = pointpats.PointPattern(coordinates)
realizations = pointpats.PoissonPointProcess(pattern.window, pattern.n, samples=1000, asPP=True)

k = 40
genv = pointpats.Genv(pattern, intervals=k, realizations=realizations) # works
fenv = pointpats.Fenv(pattern, intervals=k, realizations=realizations) # works
jenv = pointpats.Jenv(pattern, intervals=k, realizations=realizations) # fails for all k>1 I've checked.

fwiw there are 419 coordinates, and I can compute the Jenv of a random pattern with 419 points.

@ljwolf ljwolf added the bug label Apr 21, 2020
@ljwolf ljwolf changed the title Jenv correction breaks Jenv binsize correction is incorrect. Apr 21, 2020
@ljwolf
Copy link
Member Author

ljwolf commented Apr 21, 2020

I've just realized this is class-specific logic residing in the superclass. This should definitely not be handled in the superclass Envelopes. Instead, if Jenv needs special behavior, we need to override Envelopes.mapper with Jenv.mapper.

Also, I think, the j function does two calculation passes (one at l587 and one immediately afterwards in the correction)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant