Giter Club home page Giter Club logo

fastgwr's Introduction

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:

$ 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:

$ pip install fastgwr

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

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

or

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

Examples

Example call to the fastgwr to fit GWR model:

$ fastgwr run -np 4 -data input.csv

Example call to the fastgwr to fit MGWR model:

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

where:

-np 4             Number of processors (e.g. 4).
-data input.csv   Input data matrix. (e.g. input.csv)
                  Can also be an URL (e.g. https://raw.github.com/
                  Ziqi-Li/FastGWR/master/Zillow-test-dataset/zillow_1k.csv)
-out results.csv  Output GWR results matrix including local parameter 
                  estimates, standard errors and local diagnostics.
-adaptive/-fixed  Adaptive Bisquare kernel (defualt) or Fixed Gaussian kernel.
-bw 1000          Pre-defined bandwidth parameter. If missing, it will
                  search (golden-section) for the optimal bandwidth and use
                  that to fit the GWR model.
-minbw 45         Lower bound in golden-section search. (e.g. 45)
-mgwr             Fitting an MGWR model.
-chunks           Number of chunks for MGWR computation (set to a larger 
                  number to reduce memory footprint).
-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
... ... ... ... ... ... ...
... ... ... ... ... ... ...
where:
X-coord: X coordinate of the location point
Y-coord: Y coordinate of the location point
y: dependent variable
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.

fastgwr's People

Contributors

alexandermichels avatar ziqi-li avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.