diff --git a/GeoHD.egg-info/PKG-INFO b/GeoHD.egg-info/PKG-INFO index 2259967..03a40ed 100644 --- a/GeoHD.egg-info/PKG-INFO +++ b/GeoHD.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: GeoHD -Version: 0.2.5 +Version: 0.2.6 Summary: A Python toolkit for geospatial hotspot detection, Avisualization, and analysis using urban data Home-page: https://github.com/yan-yuchen/GeoHD Author: Yuchen Yan @@ -18,8 +18,8 @@ Requires-Dist: h3 # GeoHD ![python](https://img.shields.io/badge/python-3.11-black) -![GitHub release](https://img.shields.io/badge/release-v0.2.5-blue) -![pypi](https://img.shields.io/badge/pypi-v0.2.5-orange) +![GitHub release](https://img.shields.io/badge/release-v0.2.6-blue) +![pypi](https://img.shields.io/badge/pypi-v0.2.6-orange) ![license](https://img.shields.io/badge/license-GNU%20AGPLv3-green) [**Getting Started**](#getting-started) @@ -153,5 +153,4 @@ The authors of the GeoHD package welcome external contributions to the source co ## Authors * Yuchen Yan -* Yuxin Wang -* Wei Quan + diff --git a/README.md b/README.md index ba9d915..12ab499 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # GeoHD ![python](https://img.shields.io/badge/python-3.11-black) -![GitHub release](https://img.shields.io/badge/release-v0.2.5-blue) -![pypi](https://img.shields.io/badge/pypi-v0.2.5-orange) +![GitHub release](https://img.shields.io/badge/release-v0.2.6-blue) +![pypi](https://img.shields.io/badge/pypi-v0.2.6-orange) ![license](https://img.shields.io/badge/license-GNU%20AGPLv3-green) [**Getting Started**](#getting-started) @@ -136,5 +136,4 @@ The authors of the GeoHD package welcome external contributions to the source co ## Authors * Yuchen Yan -* Yuxin Wang -* Wei Quan + diff --git a/dist/GeoHD-0.2.5.tar.gz b/dist/GeoHD-0.2.5.tar.gz deleted file mode 100644 index 5631d20..0000000 Binary files a/dist/GeoHD-0.2.5.tar.gz and /dev/null differ diff --git a/dist/GeoHD-0.2.5-py3-none-any.whl b/dist/GeoHD-0.2.6-py3-none-any.whl similarity index 87% rename from dist/GeoHD-0.2.5-py3-none-any.whl rename to dist/GeoHD-0.2.6-py3-none-any.whl index 21995bf..acf2a14 100644 Binary files a/dist/GeoHD-0.2.5-py3-none-any.whl and b/dist/GeoHD-0.2.6-py3-none-any.whl differ diff --git a/dist/geohd-0.2.6.tar.gz b/dist/geohd-0.2.6.tar.gz new file mode 100644 index 0000000..ef53c55 Binary files /dev/null and b/dist/geohd-0.2.6.tar.gz differ diff --git a/doc/source/changelog.md b/doc/source/changelog.md index f1d9558..9b3025a 100644 --- a/doc/source/changelog.md +++ b/doc/source/changelog.md @@ -1,6 +1,10 @@ # Changelog -## Version 0.2.5 (April 13, 2014) +## Version 0.2.6 (April 19, 2024) + +Updated documentation. + +## Version 0.2.5 (April 13, 2024) Improved documentation and made minor adjustments to some function comments. diff --git a/doc/source/index.md b/doc/source/index.md index bfecf0a..f2c5d56 100644 --- a/doc/source/index.md +++ b/doc/source/index.md @@ -1,8 +1,8 @@ # GeoHD ![python](https://img.shields.io/badge/python-3.11-black) -![GitHub release](https://img.shields.io/badge/release-v0.2.5-blue) -![pypi](https://img.shields.io/badge/pypi-v0.2.5-orange) +![GitHub release](https://img.shields.io/badge/release-v0.2.6-blue) +![pypi](https://img.shields.io/badge/pypi-v0.2.6-orange) ![license](https://img.shields.io/badge/license-GNU%20AGPLv3-green) @@ -43,8 +43,7 @@ The authors of the GeoHD package welcome external contributions to the source co ## Authors * Yuchen Yan -* Yuxin Wang -* Wei Quan + ```{toctree} --- diff --git a/doc/source/theory.md b/doc/source/theory.md index db4d382..6a18033 100644 --- a/doc/source/theory.md +++ b/doc/source/theory.md @@ -15,67 +15,4 @@ Existing studies often remain confined to singular research contexts, lacking co GeoHD is a Python toolbox designed for the detection, visualization, and analysis of geographical spatial hotspots. Its primary objective is to provide a user-friendly tool applicable across various urban research backgrounds for hotspot detection and analysis. -### Adaptive Kernel Density Estimation - -The Adaptive Kernel Density Estimation (AKDE) is a technique tailored to adjust the bandwidth of Kernel Density Estimation (KDE) in accordance with the spatial arrangement of disparate datasets. This research refines the AKDE for pinpointing hotspots within urban confines through a trio of sequential stages: preliminary assessment, local bandwidth specification, and computation of kernel density. - -#### Step 1: Initial Assessment - -The initial assessment phase entails creating an initial approximation of the distribution of the event under study, denoted as $S$, by employing kernel density estimation with an assigned bandwidth. A Gaussian function is utilized as the core function for this preliminary approximation. Given a dataset comprising $N$ points within the research area, with each event $s_i$ located at coordinates $\langle x_i, y_i \rangle$, the initial estimate of the density $f_{\tilde{HS}}(s)$ is derived as follows: - -$$f_{\tilde{HS}}(s) = \frac{1}{N} \sum_{i=1}^{N} K_{H}(s - s_i) \tag{1}$$ - -The core function $K_{H}(s - s_i)$ is a Gaussian with bandwidth $H$: - -$$K_{H}(s - s_i) = \frac{1}{2\pi H_1 H_2} \exp\left(-\frac{(x - x_i)^2}{2H_1^2} - \frac{(y - y_i)^2}{2H_2^2}\right) \tag{2}$$ - -The bandwidth $H$ is composed of the longitudinal bandwidth $H_1$ and the latitudinal bandwidth $H_2$: - -$$H_1 = 1.06N^{-1/5} \sqrt{\frac{1}{N} \sum_{i=1}^{N} (x_i - \frac{1}{N} \sum_{j=1}^{N} x_j)^2} \tag{3}$$ - -$$H_2 = 1.06N^{-1/5} \sqrt{\frac{1}{N} \sum_{i=1}^{N} (y_i - \frac{1}{N} \sum_{j=1}^{N} y_j)^2} \tag{4}$$ - -#### Step 2: Specification of Local Bandwidth - -Utilizing the outcomes from the initial assessment, the local bandwidth at $s_i$, denoted as $h_i$, is ascertained: - -$$h_i = \left(\left(g^{-1} f_{\tilde{HS}}(s_i)\right)^{-\alpha}\right) \tag{5}$$ - -The parameter $\alpha$ is a sensitivity factor that ranges from 0 to 1, inclusive. A higher value of $\alpha$ results in more pronounced variations in local bandwidths. The geometric mean $g$ is defined as: - -$$g = \sqrt{n \prod_{i=1}^{n} f_{\tilde{HS}}(s_i)} \tag{6}$$ - -#### Step 3: Computation of Kernel Density - -The AKDE is ultimately computed using the local bandwidths: - -$$f_{HS}(s) = \frac{1}{N} \sum_{i=1}^{N} K_{H_{h_i}}(s - s_i) \tag{7}$$ - -$$K_{H_{h_i}}(s - s_i) = \frac{1}{2\pi H_1 H_2 h_i^2} \exp\left(-\frac{(x - x_i)^2}{2H_1^2 h_i^2} - \frac{(y - y_i)^2}{2H_2^2 h_i^2}\right) \tag{8}$$ - -In areas characterized by a dense concentration of events, the larger initial estimate from Eq. (1) used in Eq. (5) will lead to a reduced local bandwidth. In contrast, areas with a sparser distribution of events will yield an expanded local bandwidth. - -Incorporating AKDE in this investigation facilitates the circumvention of estimation biases associated with a fixed bandwidth and enhances the precision of spatial distribution variations in event occurrences. - -### Hotspot Recognition - -The process of identifying local hotspots of events within a study area involves a series of computational steps. Initially, we examine the dataset `S` consisting of events that have occurred within the area of interest, represented as `S = {s_1, s_2, ..., s_N}`. Following an adaptive kernel density analysis, we generate a raster dataset that depicts the density field. We then proceed with further manipulations of this raster data. Utilizing a window analysis technique, we compute a pixel maximum value surface from the raster data. Subsequently, we engage in a map algebraic operation, subtracting the pixel maximum value surface from the density field surface to create a subtracted surface, which is a non-negative value surface. Locations with zero values in the subtracted surface indicate the positions of local hotspots in the current area. After the window analysis, we employ a reclassification technique to segregate the extreme value regions from the non-extreme value areas into two distinct classes. The extreme value regions, identified through this method, correspond to the hotspots of events in the current area, denoted as `HS = {hs_1, hs_2, ..., hs_K}`. The specific steps of this methodology are as follows: - -#### Step 1: Data Input -Introduce the dataset `S`, which contains events from the study area, into the computational system. - -#### Step 2: Adaptive Kernel Density Analysis -Subject the dataset `S` to an adaptive kernel density analysis to produce a raster dataset representing the density field. This dataset mirrors the spatial arrangement of events within the study area. - -#### Step 3: Window Analysis Method -Implement the window analysis method to calculate the pixel maximum value surface from the raster data. This step yields the highest density value within each defined window. - -#### Step 4: Map Algebra Subtraction Operation -Execute a map algebraic subtraction between the density field surface and the pixel maximum value surface to generate a subtracted surface. Locations within each window that exhibit zero values are indicative of local hotspots in the current area. - -#### Step 5: Reclassification Algorithm -Apply a reclassification algorithm to divide the subtracted surface into two categories: regions with extreme values and regions without extreme values. - -#### Step 6: Hotspot Extraction -Isolate the regions with extreme values from the reclassified dataset to extract the set of hotspots `HS`, which correspond to areas of event occurrence within the current area. diff --git a/setup.py b/setup.py index 8526656..89e95fd 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='GeoHD', - version='0.2.5', + version='0.2.6', description='A Python toolkit for geospatial hotspot detection, Avisualization, and analysis using urban data', author='Yuchen Yan', author_email='ycyan001@gmail.com',