-
Notifications
You must be signed in to change notification settings - Fork 314
Closed
Description
A user is running into the following error running the lag model:
/Users/serge/Dropbox/pysal/src/git/pysal/pysal/spreg/diagnostics_tsls.py in pr2_spatial(tslsreg)
327 y = tslsreg.y
328 predy_e = tslsreg.predy_e
--> 329 pr = pearsonr(y,predy_e)[0]
330 pr2_result = float(pr**2)
331 return pr2_result
AttributeError: 'NoneType' object has no attribute 'shape'The original call was:
splagAll = ps.spreg.GM_Lag(y,x,w=w,name_y=y_name,name_x=x_names,name_w='1r',name_ds='data.txt')In tracing this back it seems that in spreg/utils.py the function sp_att will return None, None if the estimate for rho is outside of |1|. This will cause the call in line 329 to fail since the second argument to pearsonr will be None.
We probably should raise a warning to the user about this since it likely points to a misspecification?