Skip to content

Commit

Permalink
pip
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziqi authored and Ziqi committed Mar 16, 2021
0 parents commit ab79cfd
Show file tree
Hide file tree
Showing 20 changed files with 209,509 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
551 changes: 551 additions & 0 deletions .ipynb_checkpoints/Results Validation against mgwr-checkpoint.ipynb

Large diffs are not rendered by default.

72 changes: 72 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@

# FastGWR
A command line tool for fast parallel computation of Geographically Weighted Regression models.


### Installation:

1. Install any MPI implementation
For Mac:

OpenMPI: https://www.open-mpi.org

or `conda install openmpi`

For PC:

Microsoft MPI: https://docs.microsoft.com/en-us/message-passing interface/microsoft-mpi

or `conda install mpich`


Make sure you have the mpi command on your path by running
`mpiexec`



2. Install mpi4py

`conda install mpi4py`


3. Install fastgwr

`pip install fastgwr`


### Example
Example call to FastGWR which can be called on desktop or HPC:
```
fastgwr run -np 4 -data input.csv -out results.csv -adaptive
```
```
where:
-np 4: using 4 processors.
-data input.csv: input data matrix.
-out results.csv: output GWR results matrix including local parameter estimates, standard errors and local diagnostics.
-adaptive: Adaptive Bisquare kernel.
-fixed: Fixed Gaussian kernel.
-constant: Adding a constant column vector of 1 to the design matrix.
-bw 1000: Pre-defined bandwidth parameter. If missing, it will (golden-section) search for the optimal bandwidth and use that to fit GWR model.
-minbw 45: Lower bound in golden-section search.
```

The input needs to be prepared in this order:

| X-coord | Y-coord | y | X1 | X2 | ...| 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
```

### Citation

[FastGWR](https://www.tandfonline.com/doi/full/10.1080/13658816.2018.1521523)

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
Loading

0 comments on commit ab79cfd

Please sign in to comment.