Skip to content

Conversation

@Ziqi-Li
Copy link
Member

@Ziqi-Li Ziqi-Li commented Nov 7, 2021

This PR allows strictly global bandwidths (inf) in both GWR/MGWR.

Users can force the bandwidth to be inf by calling:

GWR(coords, y, X, bw=np.inf, constant=True).fit()

The result will be exactly the same to OLS's.

In bandwidth selection users can allow to try global bandwidth by setting the bw_max = np.inf:

sel = Sel_BW(coords,y, X, constant=True)
bw = sel.search(verbose=True, bw_max=np.inf)

In MGWR, users can force some of the variables to have strictly global bandwidths by setting the minimum bandwidth searching for that covariate to be np.inf, for example.

sel = Sel_BW(coords,y,X,multi=True,constant=True)
bws = sel.search(verbose=True,multi_bw_min=[None,np.inf,np.inf])
#print(bws) -> [195,  inf , inf]

Or to allow the possibility of an inf bandwidth by setting the maximum bandwidth to be np.inf:

sel = Sel_BW(coords,y,X,multi=True,constant=True)
bws = sel.search(verbose=True,multi_bw_max=[None,np.inf,np.inf])
#print(bws) -> [70, 50, inf]

See this notebook for details.

@Ziqi-Li Ziqi-Li closed this Nov 7, 2021
@Ziqi-Li Ziqi-Li added the enhancement New feature or request label Nov 7, 2021
@Ziqi-Li Ziqi-Li reopened this Nov 7, 2021
* Create unittest.yml

Add unites action

* Create 37.yaml

* Update 37.yaml

* Create 38.yaml

* Create 39.yaml

* Create 39-DEV.yaml

* Update 39-DEV.yaml

* Delete .travis.yml
@Ziqi-Li
Copy link
Member Author

Ziqi-Li commented Nov 8, 2021

It seems that Travis is not working anymore. So following other repos in PySAL, I switched to the Git's Workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant