Comments (7)
@SFashandi Thank you for reporting the issue. Could you provide the data for points
used in your example?
from pointpats.
Hi,
I attached to this comment 2D points database which I've implemented in caculating G, F, and J Test.
please consider this case.
thanks.
from pointpats.
@ljwolf there does seem to be an issue with setting support for the J function. In the notebook example, setting support
to be 15 will give me the warning: UserWarning: requested 15 bins to evaluate the J function, but it reaches infinity at d=24.7366, meaning only 10 bins will be used to characterize the J function. observed_support, observed_statistic = stat_function(
. Setting support
to be 20 will sometimes give me the error message ValueError: operands could not be broadcast together with shapes (13,) (15,)
. Can you look into this when you have a chance? BTW, both ripley.py and distance_statistics.py are implementations of distance based stats that are numpy oriented, should we remove ripley.py
(I ran into errors when using this module), update the notebook, and keep distance_statistics.py only?
from pointpats.
Yes, only one needs to be kept, and you're right that distance_statistics
is the correct one to keep.
On the shaping issue, I think it's related to undefined behaviour for some of the functions at the edges of their support. I will try to get this fixed ASAP!
from pointpats.
Thanks @ljwolf!
@SFashandi you may want to replace from pointpats import ripley
with from pointpats import distance_statistics as ds
and access all the distance functions from ds
instead of ripley
. So instead of ripley.j_test(points, support=20)
, you will use ds.j_test(points, support=20)
. Also change the value passed to the parameter support
to be smaller than 20, which should help avoid the error you are currently encountering. Our team will investigate the issue to provide a more satisfactory solution later on. Thank you for reporting this!
from pointpats.
ok @weikang9009, I think it's sufficient for now to use truncate=False
when running the statistical tests.
from pointpats.
To be clear, the issue is that the g()
and f()
functions can hit their limiting/undefined values at different times. Truncating g()
separately from f()
, then, can mean your g()
statistic vector is too short (or long) to compare to your f()
statistic vector. Since j()
is the quotient of f()
and g()
, that's a problem.
So, we must use the full-length g()
or f()
, then truncate (if requested) after the fact.
We truncate because it's annoying for the user to get back arrays that can't quickly be plotted. If you ask for a support of 20, but the last 2 are np.inf
(which is a valid return value for the j()
function), then your plots are all blank. Truncating keeps the visible range of the function clear.
from pointpats.
Related Issues (20)
- cannot import name 'G' from 'pointpats' HOT 7
- How to calculate areas of grid in Quadrat Statistics? HOT 1
- CI: TypeError: float() argument must be a string or a number, not 'PointPattern' HOT 3
- ripley.py vs distance_statistics.py duplication? HOT 1
- argument of type 'builtin_function_or_method' is not iterable HOT 1
- usage of `intensity` within `random.py` distributions? HOT 2
- `seed` keyword for random distributions? HOT 3
- release 2.4.0 HOT 2
- Building docs on 3.11 is broken HOT 3
- spacetime.py requires geopandas and shapely that are not among requirements HOT 1
- distance_statistics.ipynb is corrupted
- geopandas-centric api HOT 7
- Typo in `random.normal` method that results in errors
- minimum support Python [2024-06] HOT 2
- bump & sync min reqs [2024-06]
- Modifying QStatistic.plot() output HOT 1
- Figure out how to get legend for plot_density
- Handle SciPy and libpysal deprecations
- Release v2.3.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pointpats.