Geographically Weighted Regression Calculator

Model spatially varying relationships with localized weighted regression. Enter coordinates, predictors, responses, and bandwidth choices. Download clean tables, summaries, and printable result sheets easily.

Calculator Inputs

Example Data Table

u v x1 x2 y
002.14.015.2
102.44.316.0
012.03.814.8
112.84.517.3
213.14.918.6
223.55.220.2
323.85.521.4
334.15.922.8

Formula Used

Distance: di = √((ui - u0)² + (vi - v0)²)

Gaussian weight: wi = exp(-0.5(di / b)²)

Bisquare weight: wi = (1 - (di / b)²)² for di < b, otherwise 0

Exponential weight: wi = exp(-di / b)

Tricube weight: wi = (1 - |di / b|³)³ for di < b, otherwise 0

Local model: y = β0(u,v) + β1(u,v)x1 + β2(u,v)x2 + ε

Weighted estimate: β = (XᵀWX)-1XᵀWy

Local prediction: ŷ0 = β0 + β1x1,0 + β2x2,0

Weighted local R²: 1 - SSE / SST

How to Use This Calculator

  1. Enter the target coordinate where you want a local model.
  2. Choose a bandwidth that reflects the local neighborhood size.
  3. Select a kernel to define distance decay.
  4. Enter the target predictor values for X1 and X2.
  5. Paste dataset rows in this order: u, v, x1, x2, y.
  6. Click the calculate button to produce local coefficients.
  7. Review the prediction, diagnostics, weights, and residual table.
  8. Use the CSV or PDF buttons to save the result.

About This Geographically Weighted Regression Calculator

Geographically weighted regression, or GWR, helps you study spatial relationships that change across a map. A global model gives one coefficient for every location. A local model gives different coefficients near each target point. That makes GWR useful for housing values, public health patterns, retail demand, land use, and environmental variation.

This calculator estimates a local regression at a chosen coordinate. It uses nearby observations, predictor values, response values, a bandwidth, and a distance kernel. The tool then creates local coefficients, a local prediction, residual values, and weighted diagnostics. You can compare how the relationship shifts when you change the target point or kernel.

Why Local Modeling Matters

Spatial data often shows nonstationarity. That means one predictor may have a strong effect in one region and a weaker effect elsewhere. GWR addresses that issue by weighting nearby records more heavily than distant records. The result is a localized model that reflects neighborhood context instead of forcing one average pattern on the whole dataset.

What This Tool Calculates

The calculator first measures distance from each observation to the target coordinate. It then assigns a weight using the selected kernel. After that, it solves a weighted least squares model with an intercept and two predictors. The output includes local beta estimates, fitted values, residuals, weighted sum of squared errors, weighted sum of squares, and a weighted local R² value.

Practical Use Cases

Use this page when you need transparent spatial regression calculations without complex software. It can support classroom exercises, quick scenario checks, prototype workflows, and exploratory analysis. Export options help you save local results for reports or documentation. The example table also shows how to structure coordinates, predictors, and response fields before running a localized regression model.

Reading the Output Carefully

Remember that local coefficients depend on the chosen bandwidth and data density. Very small bandwidths may overfit noise. Very large bandwidths may behave like a global regression. Zero or tiny weights can also reduce local stability. For better interpretation, test several bandwidth values, review residual patterns, and confirm that nearby observations represent the process you want to measure. Interpret locations with strong domain knowledge. This supports clearer local spatial interpretation.

FAQs

1. What does GWR measure?

GWR estimates location specific regression coefficients. It shows how predictor effects change across space instead of assuming one constant relationship for the whole study area.

2. Why do I need coordinates?

Coordinates define where each observation sits in space. The calculator uses them to measure distances from the target location and assign local weights.

3. What does bandwidth control?

Bandwidth controls how quickly weights decline with distance. Smaller values emphasize nearby observations more strongly. Larger values create smoother and more global results.

4. Which kernel should I choose?

Gaussian gives smooth nonzero weights. Bisquare trims distant points outside the bandwidth. Exponential declines steadily. Compare outputs and choose the kernel that best matches your spatial process.

5. Why can the model fail?

The local matrix can become singular when predictors lack variation, weights are too small, or too few effective observations remain near the target point.

6. What is local R²?

Local R² summarizes how well the weighted local model explains variation around the chosen coordinate. It should be interpreted with bandwidth and kernel choices in mind.

7. Can I export the results?

Yes. The page provides CSV export for the result table and a print friendly PDF style download for summaries, coefficients, and diagnostics.

8. How should I prepare my data?

Use numeric coordinates, two numeric predictors, and one numeric response. Keep units consistent and avoid duplicate rows that add no local information.

Related Calculators

voronoi diagram calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.