Description Usage Arguments Details Value Author(s) References See Also Examples

This function fits a geographically weighted ridge regression (GWRR) model

1 |

`form` |
A regression model forumula, as in the functions lm and glm |

`locs` |
A matrix of spatial coordinates of data points, where the x coordinate is first, then the y coordinate; coordinates are assumed to not be latitude and longitude, as Euclidean distance is calculated from coordinates |

`data` |
A data frame with data to fit model |

`kernel` |
A kernel weighting function, either exp or gauss, where exponential function is default |

`bw` |
Either TRUE to estimate a bandwidth for the kernel function, or the bandwidth to use to fit the model; bandwidth is estimated by default |

`rd` |
Either TRUE to estimate a ridge shrinkage parameter, or the ridge parameter to use to fit the model; ridge parameter is estimated by default |

`cv.tol` |
A stopping tolerance in terms of cross-validation error for the bi-section search routine to estimate the kernel bandwidth using cross-validation; if missing an internally calculated value is used |

This function estimates penalized spatially varying coefficients using the GWR and ridge regression approaches. Spatial kernel weights are applied to observations using the estimated or supplied kernel bandwidth to estimate local models at each data point. The bandwidth is estimated with cross-validation with an exponential or Gaussian kernel function. The regression coefficients are penalized with a ridge parameter that is estimated with cross-validation. The function estimates regression coefficients, the outcome variable values, and the model fit.

A list with the following items:

`phi ` |
Kernel bandwidth |

`lambda ` |
Ridge shrinkage parameter |

`RMSPE ` |
Root mean squared prediction error from bandwidth estimation |

`beta ` |
Matrix of estimated regression coefficients, where a row contains the coefficients for one regression term for all data points |

`yhat ` |
Estimated outcome variable values |

`RMSE ` |
Root mean squared error from estimation |

`rsquare ` |
Approximate R-square for GWR model |

David Wheeler

Wheeler DC (2007) Diagnostic tools and a remedial method for collinearity in geographically weighted regression. Environment and Planning A, 39: 2464-2481

1 2 3 4 5 6 | ```
data(columbus)
locs <- cbind(columbus$x, columbus$y)
col.gwrr <- gwrr.est(crime ~ income + houseval, locs, columbus, "exp", bw=2.00, rd=0.03)
plot(col.gwrr$beta[2,], col.gwrr$beta[3,])
plot(columbus$x, columbus$y, cex=col.gwrr$beta[1,]/10)
col.gwr <- gwrr.est(crime ~ income + houseval, locs, columbus, "exp", bw=col.gwrr$phi, rd=0)
``` |

```
Loading required package: fields
Loading required package: spam
Loading required package: grid
Spam version 1.4-0 (2016-08-29) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.
Attaching package: 'spam'
The following objects are masked from 'package:base':
backsolve, forwardsolve
Loading required package: maps
Loading required package: lars
Loaded lars 1.2
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.