pysal / mgwr

Multiscale Geographically Weighted Regression (MGWR)
https://mgwr.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
368 stars 126 forks source link

MGWR function not accepting the bw value or array #98

Closed PratyushTripathy closed 3 years ago

PratyushTripathy commented 3 years ago

Creating the mgwr_model using the MGWR function requires the bandwidth parameter. However, it does not accept a value or the array as shown in the paper. The error says "AttributeError: 'numpy.ndarray' object has no attribute 'bw'" (screenshot attached). This implies that it requires the selector object as opposed to the bandwidth value or array. I passed the bandwidth selector object in place of the value and it worked! (screenshot attached)

mgwr_bw_error mgwr_bw_resolved
Ziqi-Li commented 3 years ago

Hi @PratyushTripathy, Thats true. We need to pass the selector object when initializing an MGWR() object because the selector actually contains more information than just the bandwidths.