Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mgwr/diagnostics.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
__author__ = "Taylor Oshan [email protected]"

import numpy as np
from scipy import linalg
from spglm.family import Gaussian, Poisson, Binomial

def get_AICc(gwr):
Expand Down Expand Up @@ -83,7 +84,6 @@ def get_CV(gwr):
return cv

def corr(cov):
sd = np.diag(np.sqrt(np.diag(cov)))
invsd = np.linalg.inv(sd)
invsd = np.diag(1/np.sqrt(np.diag(cov)))
cors = np.dot(np.dot(invsd, cov), invsd)
return cors
3 changes: 2 additions & 1 deletion mgwr/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
__author__ = "Taylor Oshan"

import numpy as np
from scipy import linalg
from copy import deepcopy
import copy
from collections import namedtuple
Expand Down Expand Up @@ -173,7 +174,7 @@ def multi_bw(init, y, X, n, k, family, tol, max_iter, rss_score,
for i in range(n):
wi = optim_model.W[i].reshape(-1,1)
xT = (X * wi).T
P = np.dot(np.linalg.inv(np.dot(xT, X)), xT)
P = linalg.solve(xT.dot(X), xT)
R[i,:,j] = X[i,j]*P[j]

XB = np.multiply(param, X)
Expand Down