spglm.glm.GLMResults(model, params, mu, w)[source]¶Results of estimated GLM and diagnostics.
| Parameters: |
|
|---|
Examples
>>> import libpysal
>>> from spglm.glm import GLM, GLMResults
>>> from spglm.family import Gaussian
>>> db = libpysal.io.open(libpysal.examples.get_path('columbus.dbf'),'r')
>>> y = np.array(db.by_col("HOVAL"))
>>> y = np.reshape(y, (49,1))
>>> X = []
>>> X.append(db.by_col("INC"))
>>> X.append(db.by_col("CRIME"))
>>> X = np.array(X).T
>>> model = GLM(y, X, family=Gaussian())
>>> results1 = model.fit()
>>> results1.aic
408.73548964604873
>>> model = results1.model
>>> params = results1.params.flatten()
>>> predy = results1.mu
>>> w = results1.w
>>> results2 = GLMResults(model, params, predy, w)
>>> results2.aic
408.73548964604873
| Attributes: |
|
|---|
Methods
conf_int([alpha, cols, method]) |
Returns the confidence interval of the fitted parameters. |
cov_params([r_matrix, column, scale, cov_p, …]) |
Returns the variance/covariance matrix. |
tvalues() |
Return the t-statistic for a given parameter estimate. |
| D2 | |
| adj_D2 | |
| adj_pseudoR2 | |
| aic | |
| bic | |
| bse | |
| deviance | |
| df_model | |
| df_resid | |
| initialize | |
| llf | |
| llnull | |
| normalized_cov_params | |
| null | |
| null_deviance | |
| pearson_chi2 | |
| pseudoR2 | |
| pvalues | |
| resid_anscombe | |
| resid_deviance | |
| resid_pearson | |
| resid_response | |
| resid_working | |
| scale | |
| tr_S |
__init__(model, params, mu, w)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
D2() |
|
__init__(model, params, mu, w) |
Initialize self. |
adj_D2() |
|
adj_pseudoR2() |
|
aic() |
|
bic() |
|
bse() |
|
conf_int([alpha, cols, method]) |
Returns the confidence interval of the fitted parameters. |
cov_params([r_matrix, column, scale, cov_p, …]) |
Returns the variance/covariance matrix. |
deviance() |
|
df_model() |
|
df_resid() |
|
initialize(model, params, **kwd) |
|
llf() |
|
llnull() |
|
normalized_cov_params() |
|
null() |
|
null_deviance() |
|
pearson_chi2() |
|
pseudoR2() |
|
pvalues() |
|
resid_anscombe() |
|
resid_deviance() |
|
resid_pearson() |
|
resid_response() |
|
resid_working() |
|
scale() |
|
tr_S() |
|
tvalues() |
Return the t-statistic for a given parameter estimate. |
Attributes
use_t |