mgwr.gwr.GWRResults

class mgwr.gwr.GWRResults(model, params, predy, S, CCT, influ, tr_STS=None, w=None)[source]

Basic class including common properties for all GWR regression models

Parameters
modelGWR object

pointer to GWR object with estimation parameters

paramsarray

n*k, estimated coefficients

predyarray

n*1, predicted y values

Sarray

n*n, hat matrix

CCTarray

n*k, scaled variance-covariance matrix

warray

n*1, final weight used for iteratively re-weighted least sqaures; default is None

Attributes
modelGWR Object

points to GWR object for which parameters have been estimated

paramsarray

n*k, parameter estimates

predyarray

n*1, predicted value of y

yarray

n*1, dependent variable

Xarray

n*k, independent variable, including constant

familyfamily object

underlying probability model; provides distribution-specific calculations

ninteger

number of observations

kinteger

number of independent variables

df_modelinteger

model degrees of freedom

df_residinteger

residual degrees of freedom

offsetarray

n*1, the offset variable at the ith location. For Poisson model this term is often the size of the population at risk or the expected size of the outcome in spatial epidemiology; Default is None where Ni becomes 1.0 for all locations

scalefloat

sigma squared used for subsequent computations

warray

n*1, final weights from iteratively re-weighted least sqaures routine

resid_responsearray

n*1, residuals of the repsonse

resid_ssscalar

residual sum of sqaures

Warray

n*n; spatial weights for each observation from each calibration point

Sarray

n*n, hat matrix

CCTarray

n*k, scaled variance-covariance matrix

ENPscalar

effective number of parameters

tr_Sfloat

trace of S (hat) matrix

tr_STSfloat

trace of STS matrix

y_bararray

weighted mean of y

TSSarray

geographically weighted total sum of squares

RSSarray

geographically weighted residual sum of squares

R2float

Global r-squared value for a Gaussian model.

adj_R2float

Adjusted global r-squared for a Gaussian model.

aicfloat

Akaike information criterion

aiccfloat

corrected Akaike information criterion to account to account for model complexity (smaller bandwidths)

bicfloat

Bayesian information criterio

localR2array

local R square

sigma2float

residual variance

std_resarray

standardized residuals

bsearray

standard errors of Betas

influarray

n*1, leading diagonal of S matrix

CooksDarray

n*1, Cook’s D

tvaluesarray

Return the t-statistic for a given parameter estimate.

adj_alphaarray

Corrected alpha (critical) values to account for multiple testing during hypothesis testing.

deviancearray

n*1, local model deviance for each calibration point

resid_deviancearray

n*1, local sum of residual deviance for each calibration point

llfscalar

log-likelihood of the full model; see pysal.contrib.glm.family for damily-sepcific log-likelihoods

pDevfloat

Local percentage of deviance accounted for.

D2float

Percentage of deviance explanied.

adj_D2float

Adjusted percentage of deviance explanied.

muarray

n*, flat one dimensional array of predicted mean response value from estimator

fit_paramsdict

parameters passed into fit method to define estimation routine

predictionsarray

p*1, predicted values generated by calling the GWR predict method to predict dependent variable at unsampled points ()

Methods

D2(self)

Percentage of deviance explanied.

ENP(self)

effective number of parameters

R2(self)

Global r-squared value for a Gaussian model.

RSS(self)

geographically weighted residual sum of squares

TSS(self)

geographically weighted total sum of squares

adj_D2(self)

Adjusted percentage of deviance explanied.

adj_R2(self)

Adjusted global r-squared for a Gaussian model.

adj_alpha(self)

Corrected alpha (critical) values to account for multiple testing during hypothesis testing.

bse(self)

standard errors of Betas

conf_int(self)

Returns the confidence interval of the fitted parameters.

cooksD(self)

Influence: leading diagonal of S Matrix

cov_params(self, cov[, exog_scale])

Returns scaled covariance parameters

critical_tval(self[, alpha])

Utility function to derive the critial t-value based on given alpha that are needed for hypothesis testing

filter_tvals(self[, critical_t, alpha])

Utility function to set tvalues with an absolute value smaller than the absolute value of the alpha (critical) value to 0.

localR2(self)

local R square

local_collinearity(self)

Computes several indicators of multicollinearity within a geographically weighted design matrix, including:

pDev(self)

Local percentage of deviance accounted for.

sigma2(self)

residual variance

spatial_variability(self, selector[, …])

Method to compute a Monte Carlo test of spatial variability for each estimated coefficient surface.

std_res(self)

standardized residuals

summary(self)

Print out GWR summary

tr_S(self)

trace of S (hat) matrix

tvalues(self)

Return the t-statistic for a given parameter estimate.

use_t(self)

bool(x) -> bool

y_bar(self)

weighted mean of y

W

adj_pseudoR2

aic

aicc

bic

deviance

df_model

df_resid

global_deviance

initialize

llf

llnull

normalized_cov_params

null

null_deviance

pearson_chi2

predictions

pseudoR2

pvalues

resid_anscombe

resid_deviance

resid_pearson

resid_response

resid_ss

resid_working

scale

__init__(self, model, params, predy, S, CCT, influ, tr_STS=None, w=None)[source]

Initialize self. See help(type(self)) for accurate signature.