Comments (3)
Great question, @iki77!
I think the choice of package really just comes down to the choice of method you want to employ.
mgwr
: effects can be different in different places
The mgwr
package is solely focused on the estimation of "geographically-weighted regression" models. At a high level, these models fit individual regressions at each site in your data. Think of it like the local model only pays attention to the data that is near that site. This means that the estimated effects, like your intercepts and your slopes/betas, can change at every site in the map. This could mean that an estimated effect of, say, age on earnings is positive in some places, but negative in others.
The mgwr
package provides methods to identify what should be considered "near" for the local models to pay attention to (Sel_Bw
classes), and also methods to estimate the local models once that has been determined (GWR
and MGWR
classes). The difference between GWR
and MGWR
is whether each variable, sometimes called a "smooth", is given its own definition of "near", or bandwidth. The MGWR
model can use a different bandwidth for each variable, whereas the GWR
model uses the same bandwidth for all variables. (you can also have some variables which are not included in the "local" specification, and must have the same values everywhere).
Some good written examples/discussions are with Oshan et al. (2019), who provides some code and explanation of the entire package or Comber et al (forthcoming), who provides some thinking as to why/how to choose between different specifications.
spreg
: Don't model sites separately, since they interact
The spreg
package is focused on the estimation of a few different kinds of models. These models, generally, are not MGWR-style models, and they "pay attention" to the entire map. However, their unique trait is generally that there is a spatial effect in play. For example, spatial dependence is a very common spatial effect. By spatial dependence, we generally mean that you cannot assume that sites are independent of one another. A classic example is the sales price of a house: if my house sells for a lot of money, my neighbor's house might increase in value, too, since it will be priced relative to mine.
The name of this kind of specification (at least that considered in spreg
) is a simultaneous autoregressive model (SAR model). When dependence is present in the outcome (y term) it is often called a "Spatial Lag" model (e.g. the ML_Lag
or GM_Lag
class), and when spatial dependence is present in the error term it is often called a "Spatial Error model" (e.g. the ML_Error
or GM_Error
classes).
spreg
also contains methods to deal with cases where your variance isn't the same across the map (some regions may have more variation than others, sometimes called spatial heteroskedasticity) and also cases where there are specific, known regions with different behavior (sometimes called "regime" models). Some good intros include the chapter in @sjsrey, @darribas, and my forthcoming book, as well as the book by Anselin & Rey.
from mgwr.
I should also say, deciding what model to use will depend on the question you're seeking to answer, and that question generally will implicate one of these sets of methods! GWR models are all about the fact that your estimated relationships can change smoothly over space. spreg models are more diverse, but generally are useful when you're just interested in the classic linear regression models, but spatial interaction or structure is getting "in the way," so to speak.
from mgwr.
Thanks for the explanation @ljwolf
It's easy to understand
from mgwr.
Related Issues (20)
- permissions for the steering council HOT 1
- Debugging LinAlgError - any idea what is going on? HOT 7
- Information about the effect of the else independent variable on the dependent variable HOT 1
- Can't upload the Data File HOT 10
- Switching from multiprocessing to joblib HOT 1
- Edit: Please delete - Binomial/Logistic Family not working
- Admit precomputed distance matrices
- How to solve the problem about the "invalid index to scalar variable" when use Sel_BW.search( ) ? HOT 3
- Undefined local variable used in search.py: golden_section (Line 46, 47) HOT 2
- Sensitivity word as variable used: search.py line 56
- Unused argument defined: search.py: function multi_bw in line 192 (family defined but not used inside function)
- Unused input argument defined: kernels.py: line 44
- What dose the pred_results.predy mean? HOT 2
- 'operands could not be broadcast together with shapes' when using 'pred_results.predictions' HOT 2
- Saving results in Python
- Crashes in QGIS
- modernize infra - `pyproject.toml` [2024-07-08]
- support Python 3.12 - add to CI matrix
- Scaling of kernel functions HOT 4
- No MGWR.predict() functionality
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mgwr.