Comments (2)
Definitely possible. Might be helpful to use the summary statement that is available in some of the spreg
functions. Running the following two stage least squares code example:
import numpy as np
import pysal
db = pysal.open(pysal.examples.get_path("columbus.dbf"), 'r')
y_var = 'CRIME'
y = np.array([db.by_col(y_var)]).reshape(49, 1)
x_var = ['INC']
x = np.array([db.by_col(name) for name in x_var]).T
yd_var = ['HOVAL']
yd = np.array([db.by_col(name) for name in yd_var]).T
q_var = ['DISCBD']
q = np.array([db.by_col(name) for name in q_var]).T
w = pysal.rook_from_shapefile(pysal.examples.get_path("columbus.shp"))
w.transform = 'r'
tsls = TSLS(y, x, yd, q, w=w, spat_diag=True, name_y=y_var, name_x=x_var,
name_yend=yd_var, name_q=q_var, name_ds='columbus', name_w='columbus.gal')
print tsls.summary
produces the following output:
REGRESSION
----------
SUMMARY OF OUTPUT: TWO STAGE LEAST SQUARES
------------------------------------------
Data set : columbus
Weights matrix :columbus.gal
Dependent Variable : CRIME Number of Observations: 49
Mean dependent var : 35.1288 Number of Variables : 3
S.D. dependent var : 16.7321 Degrees of Freedom : 46
Pseudo R-squared : 0.2794
------------------------------------------------------------------------------------
Variable Coefficient Std.Error z-Statistic Probability
------------------------------------------------------------------------------------
CONSTANT 88.4657958 15.1346096 5.8452645 0.0000000
INC 0.5200379 1.4146781 0.3676016 0.7131703
HOVAL -1.5821659 0.7931892 -1.9946891 0.0460768
------------------------------------------------------------------------------------
Instrumented: HOVAL
Instruments: DISCBD
DIAGNOSTICS FOR SPATIAL DEPENDENCE
TEST MI/DF VALUE PROB
Anselin-Kelejian Test 1 1.158 0.2820
================================ END OF REPORT =====================================
from gwr.
If you look into that summary-table-building code in spreg, it's.... a bit hairy. I'd highly recommend we try something like a jinja template rather than doing a ton of string munging.
from gwr.
Related Issues (15)
- Move MGWR HOT 1
- Thoughts about adaptive gaussian HOT 2
- For fit parameters, use sklearn trailing `_` notation? HOT 1
- Excessive computation in golden_section search can be avoided HOT 3
- calling `search` modifies the method `search`, so it can only be called once. HOT 3
- Profiling for speed-up HOT 3
- Predition jpynb is broken HOT 1
- TypeError: ('Unsupported kernel function ', 'bisquare') HOT 4
- #Offset does not yet do anyhting and needs to be implemented HOT 3
- gwr is using example files that are not in libpysal (but in old pysal) HOT 1
- GWR speed-up HOT 1
- Support for projected coordinates HOT 1
- Add "Global" R-squared HOT 1
- Resolve divide-by-zero issue for Gaussian GWR HOT 3
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 gwr.