You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-36-2a848adc0fbe> in <module>
----> 1 m2 = ps.spreg.GM_Lag(yy, y2, w=w, spat_diag=True)
/usr/local/lib/python3.8/site-packages/pysal/spreg/twosls_sp.py in __init__(self, y, x, yend, q, w, w_lags, lag_q, robust, gwk, sig2n_k, spat_diag, vm, name_y, name_x, name_yend, name_q, name_w, name_gwk, name_ds)
495 self.name_w = USER.set_name_w(name_w, w)
496 self.name_gwk = USER.set_name_w(name_gwk, gwk)
--> 497 SUMMARY.GM_Lag(reg=self, w=w, vm=vm, spat_diag=spat_diag)
498
499
/usr/local/lib/python3.8/site-packages/pysal/spreg/summary_output.py in GM_Lag(reg, vm, w, spat_diag, regimes)
152 reg.__summary = {}
153 # compute diagnostics and organize summary output
--> 154 beta_diag_lag(reg, reg.robust, error=False)
155 if spat_diag:
156 # compute diagnostics and organize summary output
/usr/local/lib/python3.8/site-packages/pysal/spreg/summary_output.py in beta_diag_lag(reg, robust, error)
719 reg.std_err = diagnostics.se_betas(reg)
720 reg.z_stat = diagnostics.t_stat(reg, z_stat=True)
--> 721 reg.pr2 = diagnostics_tsls.pr2_aspatial(reg)
722 # organize summary output
723 reg.__summary['summary_std_err'] = robust
/usr/local/lib/python3.8/site-packages/pysal/spreg/diagnostics_tsls.py in pr2_aspatial(tslsreg)
213 y = tslsreg.y
214 predy = tslsreg.predy
--> 215 pr = pearsonr(y, predy)[0]
216 pr2_result = float(pr ** 2)
217 return pr2_result
/usr/local/lib/python3.8/site-packages/scipy/stats/stats.py in pearsonr(x, y)
3854 return dtype(np.sign(x[1] - x[0])*np.sign(y[1] - y[0])), 1.0
3855
-> 3856 xmean = x.mean(dtype=dtype)
3857 ymean = y.mean(dtype=dtype)
3858
/usr/local/lib/python3.8/site-packages/numpy/core/_methods.py in _mean(a, axis, dtype, out, keepdims)
158 is_float16_result = True
159
--> 160 ret = umr_sum(arr, axis, dtype, out, keepdims)
161 if isinstance(ret, mu.ndarray):
162 ret = um.true_divide(
TypeError: No loop matching the specified signature and casting was found for ufunc add
The text was updated successfully, but these errors were encountered:
jooglyp
changed the title
Pysal/numpy incompatability? No loop matching the specified signature and casting was found for ufunc add
Pysal/numpy incompatibility? No loop matching the specified signature and casting was found for ufunc add
Jun 11, 2021
Quoting: https://stackoverflow.com/questions/64727148/pysal-in-python-error-no-loop-matching-the-specified-signature-and-casting-was
I am using the pysal package to do some spatial regressions. I am adopting the example here where the dataset is here:
This is what I am doing:
However if I want to use another model, such as GM_Lag
I get the following error
The text was updated successfully, but these errors were encountered: