项目作者: Ziqi-Li

项目描述 :
Fast Geographically Weighted Regression (FastGWR)
高级语言: Jupyter Notebook
项目地址: git://github.com/Ziqi-Li/FastGWR.git
创建时间: 2018-04-20T22:38:16Z
项目社区:https://github.com/Ziqi-Li/FastGWR

开源协议:MIT License

下载


PyPI
GitHub

FastGWR

A command line tool for fast parallel computation of Geographically Weighted Regression models (GWR and MGWR).

New feature:

Multi-scale GWR model added!

Installation:

The fastgwr program is dependent on mpi4py package and a working MPI implementation. The easiest way to install both dependencies is to use conda:

  1. $ conda install mpi4py

By installing mpi4py, conda will also install an MPI implementation based on your computer system (OpenMPI for Mac/Linux; MPICH/MS-MPI for Windows). Users may want to check whether the MPI implementation is successfully installed and is on your path by running the mpiexec command. Then the fastgwr program can be installed from PyPi:

  1. $ pip install fastgwr

After sucessful installation, users can test the functionalities from the command line by running:

  1. # Using zillow sample data for testing MGWR model fitting.
  2. $ fastgwr testgwr

or

  1. # Using zillow sample data for testing MGWR model fitting.
  2. $ fastgwr testmgwr

Examples

Example call to the fastgwr to fit GWR model:

  1. $ fastgwr run -np 4 -data input.csv

Example call to the fastgwr to fit MGWR model:

  1. $ fastgwr run -np 4 -data input.csv -mgwr

where:

  1. -np 4 Number of processors (e.g. 4).
  2. -data input.csv Input data matrix. (e.g. input.csv)
  3. Can also be an URL (e.g. https://raw.github.com/
  4. Ziqi-Li/FastGWR/master/Zillow-test-dataset/zillow_1k.csv)
  5. -out results.csv Output GWR results matrix including local parameter
  6. estimates, standard errors and local diagnostics.
  7. -adaptive/-fixed Adaptive Bisquare kernel (defualt) or Fixed Gaussian kernel.
  8. -bw 1000 Pre-defined bandwidth parameter. If missing, it will
  9. search (golden-section) for the optimal bandwidth and use
  10. that to fit the GWR model.
  11. -minbw 45 Lower bound in golden-section search. (e.g. 45)
  12. -mgwr Fitting an MGWR model.
  13. -chunks Number of chunks for MGWR computation (set to a larger
  14. number to reduce memory footprint).
  15. -estonly Allowing MGWR to output parameter estimation only.

The input needs to be prepared in this order:

X-coord y-coord y X1 X2 X3 Xk
  1. where:
  2. X-coord: X coordinate of the location point
  3. Y-coord: Y coordinate of the location point
  4. y: dependent variable
  5. X1...Xk: independent variables

See the example Zillow datasets in the repository.

Results Validation

The results are validated against the mgwr, which can be seen in the notebooks here.

Citations

This program is developed based on these two papers:

FastGWR

Li, Z., Fotheringham, A. S., Li, W., Oshan, T. (2019). Fast Geographically Weighted Regression (FastGWR): A Scalable Algorithm to Investigate Spatial Process Heterogeneity in Millions of Observations. International Journal of Geographic Information Science. doi: 10.1080/13658816.2018.1521523.

FastMGWR

Li, Z., & Fotheringham, A. S. (2020). Computational improvements to multi-scale geographically weighted regression. International Journal of Geographical Information Science, 34(7), 1378-1397.