statsmodels.gam.generalized_additive_model.GLMGamResults¶
-
class
statsmodels.gam.generalized_additive_model.GLMGamResults(model, params, normalized_cov_params, scale, **kwds)[source]¶ Results class for generalized additive models, GAM.
This inherits from GLMResults.
Warning: some inherited methods might not correctly take account of the penalization
GLMGamResults inherits from GLMResults All methods related to the loglikelihood function return the penalized values.
Notes
status: experimental
Attributes
edf list of effective degrees of freedom for each column of the design matrix. hat_matrix_diag diagonal of hat matrix gcv generalized cross-validation criterion computed as gcv = scale / (1. - hat_matrix_trace / self.nobs)**2cv cross-validation criterion computed as cv = ((resid_pearson / (1 - hat_matrix_diag))**2).sum() / nobsMethods
conf_int([alpha, cols])Construct confidence interval for the fitted parameters. cov_params([r_matrix, column, scale, cov_p, …])Compute the variance/covariance matrix. f_test(r_matrix[, cov_p, scale, invcov])Compute the F-test for a joint linear hypothesis. get_hat_matrix_diag([observed, _axis])Compute the diagonal of the hat matrix get_influence([observed])Get an instance of GLMInfluence with influence and outlier measures get_prediction([exog, exog_smooth, transform])compute prediction results initialize(model, params, **kwargs)Initialize (possibly re-initialize) a Results instance. load(fname)Load a pickled results instance normalized_cov_params()See specific model class docstring partial_values(smooth_index[, include_constant])contribution of a smooth term to the linear prediction plot_added_variable(focus_exog[, …])Create an added variable plot for a fitted regression model. plot_ceres_residuals(focus_exog[, frac, …])Conditional Expectation Partial Residuals (CERES) plot. plot_partial(smooth_index[, plot_se, cpr, …])plot the contribution of a smooth term to the linear prediction plot_partial_residuals(focus_exog[, ax])Create a partial residual, or ‘component plus residual’ plot for a fitted regression model. predict([exog, exog_smooth, transform])” remove_data()Remove data arrays, all nobs arrays from result and model. save(fname[, remove_data])Save a pickle of this instance. summary([yname, xname, title, alpha])Summarize the Regression Results summary2([yname, xname, title, alpha, …])Experimental summary for regression Results t_test(r_matrix[, cov_p, scale, use_t])Compute a t-test for a each linear hypothesis of the form Rb = q. t_test_pairwise(term_name[, method, alpha, …])Perform pairwise t_test with multiple testing corrected p-values. test_significance(smooth_index)hypothesis test that a smooth component is zero. wald_test(r_matrix[, cov_p, scale, invcov, …])Compute a Wald-test for a joint linear hypothesis. wald_test_terms([skip_single, …])Compute a sequence of Wald tests for terms over multiple columns. Methods
conf_int([alpha, cols])Construct confidence interval for the fitted parameters. cov_params([r_matrix, column, scale, cov_p, …])Compute the variance/covariance matrix. f_test(r_matrix[, cov_p, scale, invcov])Compute the F-test for a joint linear hypothesis. get_hat_matrix_diag([observed, _axis])Compute the diagonal of the hat matrix get_influence([observed])Get an instance of GLMInfluence with influence and outlier measures get_prediction([exog, exog_smooth, transform])compute prediction results initialize(model, params, **kwargs)Initialize (possibly re-initialize) a Results instance. load(fname)Load a pickled results instance normalized_cov_params()See specific model class docstring partial_values(smooth_index[, include_constant])contribution of a smooth term to the linear prediction plot_added_variable(focus_exog[, …])Create an added variable plot for a fitted regression model. plot_ceres_residuals(focus_exog[, frac, …])Conditional Expectation Partial Residuals (CERES) plot. plot_partial(smooth_index[, plot_se, cpr, …])plot the contribution of a smooth term to the linear prediction plot_partial_residuals(focus_exog[, ax])Create a partial residual, or ‘component plus residual’ plot for a fitted regression model. predict([exog, exog_smooth, transform])” remove_data()Remove data arrays, all nobs arrays from result and model. save(fname[, remove_data])Save a pickle of this instance. summary([yname, xname, title, alpha])Summarize the Regression Results summary2([yname, xname, title, alpha, …])Experimental summary for regression Results t_test(r_matrix[, cov_p, scale, use_t])Compute a t-test for a each linear hypothesis of the form Rb = q. t_test_pairwise(term_name[, method, alpha, …])Perform pairwise t_test with multiple testing corrected p-values. test_significance(smooth_index)hypothesis test that a smooth component is zero. wald_test(r_matrix[, cov_p, scale, invcov, …])Compute a Wald-test for a joint linear hypothesis. wald_test_terms([skip_single, …])Compute a sequence of Wald tests for terms over multiple columns. Properties
aicAkaike Information Criterion -2 * llf + 2*(df_model + 1) bicBayes Information Criterion deviance - df_resid * log(nobs) bseThe standard errors of the parameter estimates. cvdevianceSee statsmodels.families.family for the distribution-specific deviance functions. edffittedvaluesPredicted values for the fitted model. gcvhat_matrix_diaghat_matrix_tracellfValue of the loglikelihood function evalued at params. llnullLog-likelihood of the model fit with a constant as the only regressor muSee GLM docstring. nullFitted values of the null model null_devianceThe value of the deviance function for the model fit with a constant as the only regressor. pearson_chi2Pearson’s Chi-Squared statistic is defined as the sum of the squares of the Pearson residuals. pvaluesThe two-tailed p values for the t-stats of the params. resid_anscombeAnscombe residuals. resid_anscombe_scaledScaled Anscombe residuals. resid_anscombe_unscaledUnscaled Anscombe residuals. resid_devianceDeviance residuals. resid_pearsonPearson residuals. resid_responseRespnose residuals. resid_workingWorking residuals. tvaluesReturn the t-statistic for a given parameter estimate. use_tFlag indicating to use the Student’s distribution in inference.