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
for j in range(n):
Wj = np.diag(optim_model.W[j])
XtW = np.dot(temp_X.T, Wj)
XtWX_inv = np.linalg.inv(np.dot(XtW, temp_X))
P = np.dot(XtWX_inv, XtW)
Aj[j,:] = temp_X[j,:] * P
This loop here basically calculates hat matrix of optim_model = gwr_func(temp_y, temp_X, bw) row by row, we could just let Aj = optim_model.S to avoid the for loop and get a big speed-up. test using GA data np.allclose(Aj, optim_model.S)yields all True.
https://github.com/pysal/gwr_private/blob/8665c8ce2459c04ba5cd9d923ac1064ba9d81729/gwr/search.py#L220
This loop here basically calculates hat matrix of
optim_model = gwr_func(temp_y, temp_X, bw)
row by row, we could just letAj = optim_model.S
to avoid the for loop and get a big speed-up.test using GA data
np.allclose(Aj, optim_model.S)
yields all True.@TaylorOshan
The text was updated successfully, but these errors were encountered: