I was looking for a python library for point pattern analysis and I found the pointpats package.
"In the pointpats package, you can visualize the results using the following QStatistic.plot() method. This shows the grid used to count the events, as well as the underlying pattern"
qstat = QStatistic(coordinates)
qstat.plot()
I understand the example but my question is that: "How can we know the cell size or is there any way that we can set the cell size manually in QStatistic?"
If there is any better alternative by which I can conduct the analysis of my data in a grid but with the capability of changing cell size, kindly do suggest.
The pointpats
package also offers the ability to perform analysis using rectangles and many other shapes.
pointpats.RectangleM
function gives you the ability to set the height and width of a rectangle, so you can get the grid you are writing about.
For example:
# Construct a point pattern object
ppo = PointPattern(x)
# Construct and set grid size 20x20
r_r = RectangleM(ppo, rectangle_width=20, rectangle_height=20)
r_r.plot()
plt.show()
I also recommend the R package spatstat
, which offers point pattern analysis, statistical tests especially for spatial data with easily accessible statistics.
R example:
liblary("spatstat")
# check if it indicates heterogeneous intensity
q<-quadrat.test(murchison$gold, nx=5, ny=5)
q
plot(q)
plot(murchison$gold, add=TRUE)
Each quadrat contains, the observed and expected counts and the Pearson residual are displayed as text.