- class statsmodels.gam.generalized_additive_model.GLMGam(endog, exog=None, smoother=None, alpha=0, family=None, offset=None, exposure=None, missing='none', **kwargs)¶
Generalized Additive Models (GAM)
This inherits from GLM.
Warning: Not all inherited methods might take correctly account of the penalization. Not all options including offset and exposure have been verified yet.
The response variable.
- exogarray_like or
This explanatory variables are treated as linear. The model in this case is a partial linear model.
Examples of smoother instances include Bsplines or CyclicCubicSplines.
Penalization weights for smooth terms. The length of the list needs to be the same as the number of smooth terms in the
Missing value handling is not supported in this class.
Extra keywords are used in call to the super classes.
Status: experimental. This has full unit test coverage for the core results with Gaussian and Poisson (without offset and exposure). Other options and additional results might not be correctly supported yet. (Binomial with counts, i.e. with n_trials, is most likely wrong in pirls. User specified var or freq weights are most likely also not correct for all results.)
Estimate the dispersion/scale.
estimate_tweedie_power(mu[, method, low, high])
Tweedie specific function to estimate scale and the variance parameter.
fit([start_params, maxiter, method, tol, ...])
estimate parameters and create instance of GLMGamResults class
fit the model subject to linear equality constraints
fit_regularized([method, alpha, ...])
Return a regularized fit to a linear regression model.
from_formula(formula, data[, subset, drop_cols])
Create a Model from a formula and dataframe.
get_distribution(params[, scale, exog, ...])
Return a instance of the predictive distribution.
Hessian of model at params
hessian_factor(params[, scale, observed])
Weights for calculating Hessian
hessian based on finite difference derivative
Fisher information matrix.
Initialize a generalized linear model.
Log-likelihood of model at params
Evaluate the log-likelihood for a generalized linear model.
Log-likelihood of model observations at params
predict(params[, exog, exposure, offset, linear])
Return predicted values for a design matrix
Gradient of model at params
weights for score for each observation
score_numdiff(params[, pen_weight, method])
score based on finite difference derivative
Gradient of model observations at params
score test for restrictions or for omitted variables
select_penweight([criterion, start_params, ...])
find alpha by minimizing results criterion
find alphas by k-fold cross-validation
Names of endogenous variables.
Names of exogenous variables.