pysal.model.mgwr.gwr.
MGWR
(coords, y, X, selector, sigma2_v1=True, kernel='bisquare', fixed=False, constant=True, dmat=None, sorted_dmat=None, spherical=False)[源代码]¶多尺度GWR估计与推理。
参数: |
|
---|
实例
#基本模型校准
>>> import pysal.lib as ps
>>> from mgwr.gwr import MGWR
>>> from mgwr.sel_bw import Sel_BW
>>> data = ps.io.open(ps.examples.get_path('GData_utm.csv'))
>>> coords = list(zip(data.by_col('X'), data.by_col('Y')))
>>> y = np.array(data.by_col('PctBach')).reshape((-1,1))
>>> rural = np.array(data.by_col('PctRural')).reshape((-1,1))
>>> fb = np.array(data.by_col('PctFB')).reshape((-1,1))
>>> african_amer = np.array(data.by_col('PctBlack')).reshape((-1,1))
>>> X = np.hstack([fb, african_amer, rural])
>>> X = (X - X.mean(axis=0)) / X.std(axis=0)
>>> y = (y - y.mean(axis=0)) / y.std(axis=0)
>>> selector = Sel_BW(coords, y, X, multi=True)
>>> selector.search(multi_bw_min=[2])
[92.0, 101.0, 136.0, 158.0]
>>> model = MGWR(coords, y, X, selector, fixed=False, kernel='bisquare', sigma2_v1=True)
>>> results = model.fit()
>>> print(results.params.shape)
(159, 4)
属性: |
|
---|
方法
fit () |
方法从sel_BW(selector)对象中提取信息,并为mgwrresults对象准备GAM估计结果。 |
predict () |
未实现。 |
df_model | |
df_resid |
__init__
(coords, y, X, selector, sigma2_v1=True, kernel='bisquare', fixed=False, constant=True, dmat=None, sorted_dmat=None, spherical=False)[源代码]¶初始化类
方法
__init__ \(坐标,Y,X,选择器[,…]) |
初始化类 |
df_model () |
|
df_resid () |
|
fit () |
方法从sel_BW(selector)对象中提取信息,并为mgwrresults对象准备GAM估计结果。 |
predict () |
未实现。 |
属性
mean_y |
|
std_y |