Merge branch 'pysal_gwr' of github.com:TaylorOshan/crankshaft into pysal_gwr

This commit is contained in:
Andy Eschbacher
2016-11-28 14:54:47 -05:00
4 changed files with 10 additions and 11 deletions

View File

@@ -59,9 +59,8 @@ def gwr(subquery, dep_var, ind_vars,
stand_errs = model.bse.reshape((-1))
predicted = np.repeat(model.predy.reshape((-1,)), k+1)
residuals = np.repeat(model.resid_response.reshape((-1,)), k+1)
r_squared = np.tile(model.localR2.reshape((-1,)), k+1)
r_squared = np.repeat(model.localR2.reshape((-1,)), k+1)
rowid = np.tile(rowid, k+1).reshape((-1,))
var_name = np.tile(ind_vars, k+1).reshape((-1,))
return zip(coefficients, stand_errs, t_vals, predicted,
residuals, r_squared, rowid)
ind_vars.insert(0, 'intercept')
var_name = np.tile(ind_vars, n).reshape((-1,))
return zip(coefficients, stand_errs, t_vals, predicted, residuals, r_squared, rowid, var_name)

View File

@@ -4,7 +4,7 @@ Diagnostics for estimated gwr modesl
__author__ = "Taylor Oshan tayoshan@gmail.com"
import numpy as np
from pysal.contrib.glm.family import Gaussian, Poisson, Binomial
from crankshaft.regression.glm.family import Gaussian, Poisson, Binomial
def get_AICc(gwr):
"""

View File

@@ -10,10 +10,10 @@ from scipy.stats import t
from kernels import *
from diagnostics import get_AIC, get_AICc, get_BIC
import pysal.spreg.user_output as USER
from pysal.contrib.glm.family import Gaussian, Binomial, Poisson
from pysal.contrib.glm.glm import GLM, GLMResults
from pysal.contrib.glm.iwls import iwls
from pysal.contrib.glm.utils import cache_readonly
from crankshaft.regression.glm.family import Gaussian, Binomial, Poisson
from crankshaft.regression.glm.glm import GLM, GLMResults
from crankshaft.regression.glm.iwls import iwls
from crankshaft.regression.glm.utils import cache_readonly
fk = {'gaussian': fix_gauss, 'bisquare': fix_bisquare, 'exponential': fix_exp}
ak = {'gaussian': adapt_gauss, 'bisquare': adapt_bisquare, 'exponential': adapt_exp}

View File

@@ -11,7 +11,7 @@ __author__ = "Taylor Oshan Tayoshan@gmail.com"
from kernels import *
from search import golden_section, equal_interval, flexible_bw
from gwr import GWR
from pysal.contrib.glm.family import Gaussian, Poisson, Binomial
from crankshaft.regression.glm.family import Gaussian, Poisson, Binomial
import pysal.spreg.user_output as USER
from diagnostics import get_AICc, get_AIC, get_BIC, get_CV
from scipy.spatial.distance import pdist, squareform